Dennis Hof has been elected to the Nevada state assembly even though he died three weeks ago.

Hof, a pimp who owned several legal brothels in Nevada, died in October but got almost 70% of the vote against his Democratic challenger.

Hof called himself "The Trump of Pahrump" and said his support was similar to the support Trump continued to receive after his "Access Hollywood" tape was released.

Hof's platform was largely conservative, as he looked to expand gun rights and vowed to take a tough stance on immigration.

A pimp who was inspired by Donald Trump to get involved in politics has been elected to Nevada's state assembly even though he died three weeks ago.

Dennis Hof, a reality-television star and pimp who owned several legal brothels, had been running for the Nevada Legislature when he was found dead on October 16, two days after this 72nd birthday.

He won his election on Tuesday, defeating the Democrat Lesia Romanov, with almost 70% of the vote.

By the time of his death, it was too late to take his name off the ballot. Republicans in the state urged voters to cast their ballot for him anyway to keep the seat from the Democrats. Under state law, if a candidate who has died is elected, local officials are to appoint someone from the same party to fill the seat.

Read more: Midterms 2018 LIVE: Democrats take the House, GOP holds the Senate in a wild election night

Hof called himself "The Trump of Pahrump," after his town in Nevada, and beat a three-term incumbent Republican in June's primary.

He told BuzzFeed in September that he thought support for him mirrored the continued support for Trump after the emergence of the "Access Hollywood" tape in which Trump bragged about groping women.

"Women were like, 'Yeah, we won't vote for him,'" Hof said. "Till they got behind the f---ing ballot box and nobody's looking. Boop: 'I want a man. I don't give a shit how many p---ies he grabs — I want a man that'll make things happen.'

"And the same thing with me."

Hof outside his brothel in Nevada in June. REUTERS/Steve Marcus/File Photo

Hof's platform was largely conservative, as he looked to expand gun rights and vowed to take a tough stance on immigration. He also wanted to push to make the brothel industry more mainstream and introduce more sex education to schools.

Read more: Diversity wins: All of the people who made history in the 2018 midterm elections

Hof previously starred in the HBO reality show "Cathouse," which chronicled life at his best-known brothel, the Bunny Ranch. He owned five brothels in Nevada, according to Reuters. Prostitution is legal in the state.

He faced multiple accusations of sexual assault, and these were under investigation when he died, according to BuzzFeed.