AUSTIN, Texas — A man who sued over the right to marry his partner said Tuesday that he is running as a Democrat in 2018 in a bid that would make him the first openly gay state senator in Texas if elected.

Mark Phariss, a lawyer from the Dallas suburb of Plano, said he is encouraged by recent high-profile Democratic upsets in Virginia and Alabama as he launches his first run for public office in Dallas’ conservative northern suburbs.

Vic Holmes, left, wipes the face of his husband Mark Phariss outside of the 5th U.S. Circuit Court of Appeals, Friday, Jan. 9, 2015, in New Orleans. Opponents and supporters of gay marriage argued their sides before the 5th U.S. Circuit Court of Appeals, on gay marriage bans in Texas, Louisiana and Mississippi. Stacy Revere / AP

Phariss and his partner, Vic Holmes, were the lead plaintiffs in a 2013 lawsuit over a Texas ban on gay marriage. The U.S. Supreme Court legalized same-sex marriage nationwide two years later.

His candidacy sets up a possible race next year against Angela Paxton, the wife of Republican Texas Attorney General Ken Paxton. Both Phariss and Angela Paxton, a school guidance counselor, face primary challengers.

“We’re spending too much time on issues that do not affect the daily lives of Texans like education does,” Phariss said of the Republican-controlled Legislature and Texas GOP leaders.

Winning will require flipping a Senate district that has been reliably Republican: The outgoing senator, Republican Van Taylor, won with nearly 80 percent of the vote in 2014. Ken Paxton also held the seat before becoming attorney general in 2015, when he advised county clerks following the Supreme Court decision on gay marriage that they could deny same-sex marriage licenses over religious objections.

Phariss’ lawsuit over the Texas gay marriage ban put him up against an old friend — Republican Texas Gov. Greg Abbott, who was the state attorney general at the time and defended the ban in that role. Abbott was friends with Phariss in law school and said in 2014 that he still considered him a friend, even though they had lost touch years earlier.

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM