DES MOINES, Iowa -- An Iowa farmer-turned-reality television star is fighting to avoid prison after driving his pickup into the back of a tractor and killing a neighbour.

Chris Soules, who became known as "Prince Farming" during his 2015 appearance on "The Bachelor" and also appeared on "The Bachelorette" and "Dancing With The Stars," lost a legal battle Friday in the felony case against him.

A judge dismissed his constitutional challenge to an Iowa law requiring the surviving driver in a fatal accident to remain at the scene until police arrive. He faces trial on Jan. 18.

Soules rear-ended a farm tractor driven by Kenneth Mosher on a rural northern Iowa road just after sunset on April 24. Mosher died soon after at a hospital.

The accident sent the tractor Mosher was driving and Soules' pickup into ditches on opposite sides of the road. Soules called 911 and identified himself, administered CPR to Mosher and remained at the scene until emergency personnel arrived. But before law enforcement could arrive, Soules was driven home.

He was arrested at 1:16 the next morning at his home near Arlington, 12 miles northeast of the accident scene. Sheriff's reports indicate he declined to let officers into his house until after they obtained a search warrant.

He was charged with failure to remain at the scene of a fatal accident, which carries a penalty of up to five years in prison.

His attorneys claim Iowa's law violates the constitutional rights of citizens to be free from unreasonable searches and seizures and to avoid self-incrimination.

The law in question says, in part, "a surviving driver shall promptly report the accident to law enforcement authorities, and shall immediately return to the scene of the accident or inform the law enforcement authorities where the surviving driver can be located."

Most states consider it a felony to leave the scene of an accident in which someone is injured or dies, but Iowa's law differs in that it has been interpreted to require the surviving driver to be present when law officers arrive.

"No other state has a comparable requirement," Soules' attorneys said in court documents.

A driver forced to meet face-to-face with police is exposed to interrogation and observation by officers and risk self-incrimination, his attorneys argued.

State prosecutors contend the purpose of the law is to prevent drivers from evading liability for driving recklessly, driving while drunk or driving with a suspended or revoked license.

"The state submits the legislature foresaw that drunk drivers could flee the scene of a fatal crash precisely because they wanted to escape and sober up before confronting law enforcement officers who may detect telltale signs of intoxication," prosecutors said in court documents.

Initial court documents Buchanan County Attorney Shawn Harden filed in May said Soules was seen purchasing alcohol at a convenience store shortly before the accident. They allege he attempted "to obfuscate the immediate facts and circumstances surrounding the accident, including a determination of his level of intoxication and an explanation of the empty and partially consumed open alcoholic beverages located in and around his vehicle ..."

Had Soules been tested at the scene or soon after and found to have been legally drunk, a much more serious charge such as vehicular homicide could have been brought. It carries a prison sentence of as much as 25 years.

Soules, 36, pleaded guilty to drunken driving in 2005 and was sentenced to one year of probation and a 60-day suspended jail sentence. In 2001, when he was 19, he twice pleaded guilty to underage possession of alcohol and also was fined for having an open container in a car.

The ruling Friday by Judge Andrea Dryer says Iowa's requirement to remain at the scene is not a seizure under the state or federal constitutions and it does not require the driver to divulge anything to police that would violate rights against self-incrimination.

Soules became a television reality show celebrity after appearing on the ABC network's "The Bachelorette" in 2014 and played the starring role in the network's "The Bachelor" in 2015. He also was chosen to be one of 12 celebrity competitors on "Dancing With The Stars" in that year but was eliminated during week eight of the competition, finishing fifth.

One of Soules' attorneys, Brandon Brown, said in court documents that he may claim as a possible defence diminished capacity "based upon his then-existing medical condition due to injuries sustained."

Brown did not provide an immediate response to the judge's ruling or indicate whether Soules would appeal to the Iowa Supreme Court but indicated a statement was planned for release Friday.