If Alabama voters choose Republican Roy Moore for the U.S. Senate in Tuesday’s special election, it won’t be the first time in the modern era that voters have sent to Congress a man dogged by a teen sex scandal.

Massachusetts voters stood by Democratic Rep. Gerry Studds even after he was censured by the House in 1983 for his sexual relationship at age 36 with a 17-year-old male congressional page, as well as making sexual advances toward two other teenage pages.

Far from dooming the Democratic Party, the episode barely registered at the ballot box. Democrats kept their House majority and gained Senate seats in 1984, while Studds was re-elected in his liberal Cape Cod district with 56 percent of the vote.

He won re-election five more times and was ultimately named chairman of the House Merchant Marine and Fisheries Committee before retiring in 1997. He died in 2006.

A national marine fishery was named for him in 1996, and in June, the University of Massachusetts Press published a biography, “Gerry Studds: America’s First Openly Gay Congressman,” which discussed the scandal as well as his achievements on domestic and foreign policy.

That is not how the scenario is expected to play out for Mr. Moore and the Republican Party if he wins Alabama’s Senate seat.

Political analysts predict a Moore victory will become the gift that keeps on giving for Democrats next year, especially after they cleaned house last week by forcing out two lawmakers accused of sexual harassment, Sen. Al Franken of Minnesota and Rep. John Conyers Jr. of Michigan. (The Republican Party also registered a sexual harassment loss last week: Rep. Trent Franks of Arizona announced his resignation over his surrogacy discussions with female staffers.)

“[T]he outcome here is there’s no good outcome for the Republicans, that either a Democrat is going to go to the U.S. Senate from the reddest state in America, or Roy Moore’s going to win and he is going to be a brand anvil on the Republican Party,” GOP strategist Scott Jennings told NPR. “And so I think, in some ways, the Republican Party’s already lost the race.”

Sen. Cory Gardner of Colorado, who heads the National Republican Senate Committee, has called for the Senate to expel Mr. Moore if he wins. He said Thursday that the NRSC will never endorse the Republican candidate.

“If Mr. Moore wins, he will haunt the Trump Presidency,” The Wall Street Journal said Thursday in an editorial. “The Democrats took their sexual harassers off the table. Mr. Trump may put his party’s in the Senate. Every day, the Democrats and the Beltway media will run the narrative that Senator Roy Moore is Donald Trump’s doppelganger.”

It was a far different story in 1984. Democrats paid virtually no political price for supporting Studds, who came out as gay during the 1983 investigation and was later celebrated as a civil rights pioneer for being the first openly homosexual elected to Congress.

A Yale graduate who could trace his lineage to Elbridge Gerry, a signer of the Declaration of Independence, Studds received support from those who argued that the episode in his “private life” had no bearing on his ability to represent his district.

Washington Post columnist Colman McCarthy rebuked “gay-baiters” in the district who called for Studds to resign. He accused them of leading a “witch hunt” over a “brief consenting homosexual relationship with a congressional page.”

“The censure should have been the end of it,” Mr. McCarthy said in a September 1983 column. “Studds said he acted stupidly and expressed regrets.”

Alcohol-fueled sexual encounters

There was considerably more focus on the welfare of pages in a recent Post op-ed by a former Senate page, who warned about the consequences of placing Mr. Moore in the vicinity of “children.”

“Whoever fills the seat from Alabama should be able to look at the pages and see hope and innocence. But Moore does not appear to see children that way,” said Madison Haddix. “How can Moore be expected to make decisions with the interests of children at heart when he stands accused of betraying children?”

Certainly there are differences between the two cases. Mr. Moore has been accused of sexually assaulting a 16-year-old girl and dating or making advances toward other teenage girls, including a 14-year-old, in the 1970s when he was in his 30s. He has denied any improper conduct, including dating teenagers.

Studds admitted to engaging in an affair with the 17-year-old page in 1973, but both he and the page told the House special counsel that their relationship was consensual. It also wasn’t illegal, given that the age of consent in the District of Columbia was 16.

That doesn’t mean there was nothing untoward about Studds‘ behavior. According to the investigation, the affair began when the congressman invited the page back to his Georgetown apartment, where they drank vodka and cranberry juice until Studds said he was too drunk to drive the boy home.

At that point, “the congressman engaged the page in sexual activity,” said the House Standards on Official Conduct Committee’s report.

The page testified that he was “flattered and excited” by Studds‘ attention but that he had reservations about the sexual aspect. He called the relationship “one of the more wonderful experiences of my life, if we exclude the instances of sexual experience, which I was somewhat uncomfortable with.”

“Well, I kept company with him because he was an intelligent man, a fun person to be with. If I could have had my druthers, I would have had the friendship that I had with the man without the sex,” the page said. “And I mentioned that to him.”

Even so, they had sex on multiple occasions, including during a two-week trip in August 1973 to Portugal, paid for without public funds.

Inviting pages back to his place and plying them with alcoholic beverages was apparently the congressman’s modus operandi. Two other male pages said they refused his sexual advances after he drove them in separate incidents to his home at night for drinks.

It got to the point where the Republican cloakroom page supervisor warned one of the pages “that [he] and the other kids should keep their distance.”

Studds never quite apologized, but he acknowledged that the relationship represented a “very serious error in judgment” while arguing that no coercion, intimidation or favoritism was involved.

The House committee special counsel advised that “such conduct constitutes improper sexual conduct” under House rules.

“The House has always regarded pages as its wards and has always accepted a special responsibility to them,” said the report.

Studds was defiant the day he was censured in a 420-3 vote, turning his back on the full House as the motion was read. His constituents gave him two standing ovations at his next town hall in Martha’s Vineyard.

He married Dean Hara in 2004, the year same-sex marriage was legalized in Massachusetts, and died two years later at age 69.

Mr. Hara defended the 12-term lawmaker’s conduct with the page by telling The Associated Press, “This young man knew what he was doing.”

The other congressman embroiled in the 1983 congressional page scandal didn’t fare so well. Rep. Dan Crane, Illinois Republican, was censured by the House on the same day as Studds after admitting to having a consensual sexual relationship with a 17-year-old female page. The following year, Mr. Crane lost his re-election bid to Democrat Terry Bruce.

Even though Mr. Crane was disciplined by the House at the same time for virtually the same offense, Studds maintained that his sexuality was a factor in his censure.

“There was a big investigation of allegations of misconduct with pages, and they nailed one heterosexual and balanced it off with one gay member,” Studds later told OutHistory in an interview.

The House shuttered its page program in 2011 after nearly 180 years, saying technological advances had made it unnecessary.