Forty-five years ago today, on Jan. 22, 1973, the U.S. Supreme Court legalized abortion across America with its historic Roe v. Wade (and companion Doe v. Bolton) decisions.

Americans regard abortion in myriad, often contradictory, ways. Is abortion a woman’s fundamental right or something that the government should regulate? Is it a potentially lifesaving medical intervention or murder? The partisan divide on these questions has helped turn abortion into one of the biggest political litmus tests of our day.

The stark party lines were drawn in 1976, the first presidential election year after the court’s decisions helped transform abortion into a national issue, with the Democratic Party affirming its support for legal abortion and the Republican Party vowing to outlaw it. But this was not always the case.

When states began to outlaw abortion in the 19th century, it was not a political — let alone a partisan — issue. Even as state after state criminalized the procedure, it did not engender much political attention or debate, largely because doing so meshed with goals shared by both parties in an era when politics was the province of white men. Criminalizing abortion was, in part, a way for the rising (male) professional medical field to consolidate women’s reproductive care under their purview and away from unlicensed (female) midwives.

These legal changes were also interwoven with nativist concerns that inferior new immigrant groups, many of them Catholic, were reproducing far more offspring than white Anglo-Saxon Protestant women. Outlawing abortion was seen as a way to increase the births of more desirable children.

By 1900, the only way to get an abortion on American soil was to somehow prove the expectant mother’s life was at risk. The only legal way, that is.

The Great Depression sparked unprecedented rates of illegal abortion, which prompted an outcry among Catholics. Leaders of the church in America had long led the opposition to legal abortion — following guidance from Rome, they considered it to be murder. Similar sentiment soon spread to the laity. In response to doctors increasingly performing illegal abortions for cash-strapped patients during the Depression, the National Federation of Catholic Physicians’ Guild issued a written condemnation of abortion in 1937.

Unlike today, these opponents were actually far more likely to be Democrats than Republicans. President Roosevelt’s New Deal reforms aligned well with the Catholic Church’s desire to soften the worst excesses of industrial capitalism, which led Catholics to become a key element of the potent New Deal Democratic coalition.

Abortion remained on the fringes of political debate until the late 1960s. Male reformers from medicine, law and some progressive religious communities, who tended to be Republican, had recently begun championing legal abortion to little effect. But the issue captured headlines when newly formed feminist groups staged political events like “abortion speak-outs,” which featured women giving firsthand accounts of illegal abortions. Other feminist groups such as the National Organization for Women (NOW) became well-versed in more traditional forms of power politics that helped move 17 states to legalize abortion under certain conditions even before Roe did so at the federal level in 1973.

Many Republicans initially supported legalized abortion. Letting women, not lawmakers, decide whether to give birth was in line with their ideological affinity for individual rights and small government. Republicans were also more likely to prefer abortion over subsequent years of taxpayer-funded support for poor women and children. Moderate Republican governor Nelson Rockefeller of New York was a main force behind his state’s abortion reform law in 1970, just as Ronald Reagan, a leader of the party’s rising conservative faction, signed a similar bill in 1967 as governor of California.

Yet legal abortion did not remain a point of commonality between the left and right flanks of the Republican Party for long. During the 1970s, harnessing opposition to legal abortion enabled conservative Republicans to capture control of the GOP from moderates like Rockefeller. They especially relied on devout Catholic (historically New Deal Democrats) and evangelical voters, who tended to see abortion in stark moral and religious terms — as murder and pure evil — and thus could be counted on to get to the polls to support conservative Republicans who vowed to recriminalize it, regardless of whether they agreed with them on other issues.

But Republicans did not just rely on antiabortion passions to override disagreement on other issues.

GOP activists like Phyllis Schlafly worked to blend longtime core conservative goals with opposition to social issues like abortion. They argued that lowering taxes, for instance, could curb abortion rates by reducing revenue for Medicaid-funded abortions for poorer women. Such arguments soon produced a successful effort to end Medicaid funding for abortion in 1976. Passage of the Hyde Amendment, the first significant legislative victory for antiabortion activists after Roe, was made possible by the efforts of homemakers who subscribed to Schlafly’s newsletter and used their more flexible schedules to lobby Congress.

As the GOP lurched rightward, Democrats did the opposite. Internal reforms beginning in the late 1960s loosened the tight grip on power that old-line New Deal Democrats had long exercised within the party. These decentralization measures aimed to give previously underrepresented groups, such as women, a greater stake in party governance. Feminists from highly organized political interest groups like NOW heeded the call, moving the Democratic Party to back legal abortion and other tenets of modern feminism.

These changes presented a particular challenge for Catholic Democrats (as well as evangelicals like Jimmy Carter), who sometimes had to square their own personal opposition to legal abortion with new party priorities. Delaware’s Democratic senator, Joe Biden, a Catholic who was first elected in 1972 and initially opposed Roe, was among those who learned to say that although he was personally opposed to abortion, he respected the Supreme Court rulings.

Not much has changed in the intervening decades: If anything, abortion has only become an even more highly charged and deeply partisan political issue. Democratic leaders will use the 45th anniversary of Roe v. Wade to reiterate their support for legal abortion — hoping to rally the base at the onset of an important midterm election year.

In this spirit, President Trump, who ended his first year in office with the lowest approval ratings of any president on record, reached out to his conservative Republican base last Friday in a fiercely antiabortion speech from the Rose Garden that was broadcast live to thousands of activists stationed at the Washington Monument for the annual March for Life. Vice President Pence and Republican Speaker of the House Paul D. Ryan also spoke.

It is unclear if this gambit will be enough to allow an unpopular president’s party to retain its congressional majorities in the 2018 midterms in November. But the past 45 years suggest addressing this large antiabortion gathering dominated by highly motivated Catholic and evangelical voters is a good place to start.