WASHINGTON, DC - APRIL 29: Japanese Prime Minister Shinzo Abe (C) speaks to a joint meeting of the US Congress in the House chamber onl April 29, 2015. A first vote to upend a D.C. law in decades is planned in the chamber on Friday. (Mark Wilson/Getty Images)

A divided House of Representatives voted along party lines late Thursday to strike down a D.C. law on ideological grounds for the first time in almost 35 years.

Republican opponents of the measure, which bans discrimination over employees’ reproductive decisions, said it constituted a liberal attack on antiabortion groups in the nation’s capital.

The effort, begun by Sen. Ted Cruz (R-Tex.) in the days before he launched his presidential campaign, sparked a fierce debate on the floor of the House late Thursday, with Democrats blasting the Republican move as an outrageous infringement on women’s reproductive rights and privacy.

The final vote was 228 to 192. with 13 Republicans siding with Democrats and three Democrats backing the Republican measure.

Citing the strong convictions of many House Republicans about the D.C. measure, House Speaker John A. Boehner (R-Ohio) brought the issue to a vote on the floor even though Senate action on a companion measure would not come in time to stop the D.C. bill from becoming law next week.

U.S. Republican presidential candidate and Rep. Ted Cruz (R-TX) (C) talks with colleagues on the House floor as he arrives Wednesday for Japanese Prime Minister Shinzo Abe's address a joint meeting of the U.S. Congress. (Jonathan Ernst/Reuters)

“The issue is one of religious liberty,” Boehner said.

Bringing the abortion-related resolution to a vote on the floor of the House highlights the social issues that have long invigorated the Republican base but increasingly repel moderate voters.

It also amounts to a calculation that Republicans will fare better discussing antiabortion stances than opposition to equal treatment for gay men and lesbians. After an uproar over an Indiana law viewed as anti-gay, House conservatives dropped another measure introduced last month by Cruz. That bill would have overturned a D.C. law ending exemptions that allow religious universities to avoid funding gay student groups.

House Democrats from more than a dozen states and D.C. lawmakers on Wednesday ripped ­Republicans’ decision to bring the reproductive non-discrimination bill to a vote, calling it an affront to women and to the District’s right to self-governance.

At a news conference Thursday, House Minority Leader Nancy Pelosi (D-Calif.) called the bill “an outrageous intrusion into workers’ personal lives” and “totally inconsistent with the anti-government rhetoric that we hear around here morning, noon and night.”

“If you don’t believe in governance, how is it that all of that is cast aside when it comes to women’s reproductive freedom?” she asked.

Pelosi made reference to the Supreme Court decision last year in Hobby Lobby v. Burwell, which allows some companies to refrain from offering contraception through employee health plans.

“This is Hobby Lobby on steroids,” she said. “And Republicans need to recognize that your own health-care choices are not your boss’s business.”

Del. Eleanor Holmes Norton (D), the District’s non-voting member of the House, weighed in as well, calling the planned vote “a new low for House Republicans, who are using the District and its residents as yet another pawn in their ongoing attack on women’s reproductive rights.”

She said, “No employer should have the right to hire and fire employees based on their most private, personal health decisions.”

Speaking to reporters, Boehner sought to explain why he agreed to bring the measure to the floor, citing “a number of members who are concerned about this issue.”

“This is about conscience protections that the president says he supports but really hasn’t put regulations in place to protect. . . . It’s, frankly, been part of our laws and statutes for decades and decades, and so our members thought it was important, and that’s why it was added to the schedule,” the speaker said.

The White House issued a statement saying the Obama administration strongly opposes the repeal of the D.C. law and warning that the president may veto it in the unlikely event it reaches his desk.

The House effort “would undermine the reproductive freedom and private health care decisions of the citizens of the District of Columbia,” the statement read. “The legislation would give employers cover to fire employees for the personal decisions they make about birth control and their reproductive health.”

The Reproductive Health Non-Discrimination Amendment Act broadens the definition of discrimination in the District to include an employee’s reproductive health decisions. Under the law, employers will not be able to discriminate against employees who seek contraception or family planning services. Employers also cannot act against an employee when they know she has used medical treatments to initiate or terminate a pregnancy.

Some conservatives have interpreted the act to mean that employers in the District, including churches and antiabortion groups such as March for Life, could eventually be required to provide coverage for contraception and abortions. The D.C. Council passed a temporary fix to make it clear that religious organizations would not be responsible for such medical care, but Republicans said the fix was insufficient.

Rep. Bill Flores (R-Tex.), chairman of the influential Republican Study Committee, said he spoke to Boehner three times in efforts to push the GOP leadership to bring the measure to a vote.

“We were unhappy with the D.C. Council’s attempts to stifle our First Amendment rights and religious liberty,” Flores said in an interview. “And yet our leadership decided for some reason that it wasn’t going to come to the floor, and so we’ve had a pretty intense week of negotiation. Fortunately . . . they made what I believe was a very good decision to allow the resolution to come to the floor.”

In a letter to members of Congress on Wednesday, the National Right to Life Committee warned that a roll-call vote would be included in its score card for the next election as “a fair reading of where each Member of the House of Representatives stands regarding a blatantly political attack on the pro-life movement.”

The organization also rejected D.C. claims of autonomy, noting that it was Congress that gave lawmakers in the federal district the right to pass local laws. “It follows that members of Congress are responsible for, and accountable for, abuses of the legal authority. . . . [I]t is a politically motivated attack on our organization and the other organizations that seek to vindicate the human rights of unborn children.”

Rep. Diane Black (R-Tenn.), who co-introduced the measure with Cruz, called it Congress’s “constitutional duty” to turn back the D.C. legislation. “While the law’s supporters in the big-abortion lobby claim that this act protects against discrimination, the truth is this oppressive measure directly targets the First Amendment freedoms of pro-life and faith-based employers in our nation’s capital,” Black said in a statement.

In a letter last week to Rep. Jason Chaffetz (R-Utah) just before his oversight committee voted to overturn the bill, Council Chairman Phil Mendelson (D) pleaded for members of Congress to leave the matter up to the city.

“The fundamental issue is whether individuals or organizations have the right to discriminate,” he wrote. “It is our view that they should not with regard to personal health choices.”

On the House floor Thursday, Rep. Jim McGovern (D-Mass.) said Republicans were wasting taxpayers’ time bringing up the local measure. “There are so many important things we should be debating, and instead we’re bringing these wedge issues to the floor.”

Rep. Jared Polis (D-Colo.) said it amounted to trampling on the District’s rights. “I don’t know what I would do” if Congress took similar action to overturn a law passed by the legislature and governor in his state, he said.

During the debate, three D.C. voting-rights activists stood up, yelled and waved a red-and-white District flag during a vote to limit debate on the measure. They were escorted from the chamber by police.

The District has more residents than either the states of Vermont or Wyoming but has no voting representation in Congress, and all of its locally passed laws and spending decisions must go before Congress for review.

The last time Congress voted to overturn a D.C. law was in 1991, when both chambers passed, and the president signed, a measure to keep D.C. officials from changing the maximum height of buildings in the city.

The last vote by Congress on a social policy set by the city was in 1981, when federal lawmakers turned back the city’s effort to erase its felony sodomy law.

The repeal would have to pass a vote in the Senate, and President Obama would have to sign it by early next week. With no chance of that happening, Republicans have urged House budget leaders to block funding for the District to enforce the reproductive discrimination law through the next federal spending bill.

Mike DeBonis contributed to this report.