WASHINGTON — It took 730 days, required two nominations and provoked untold Senate acrimony, but the U.S. Senate yesterday confirmed former Ohio Attorney General Richard Cordray as the head of a federal consumer watchdog agency.

The final Senate vote was 66-34. Both of Ohio’s senators, Democrat Sherrod Brown and Republican Rob Portman, supported it.

But the key vote came earlier in the day, when the Senate, by a 71-29 vote, agreed to end debate on Cordray’s nomination, a procedural necessity for him to be formally confirmed and an indication that Cordray’s time in nomination limbo was up. Portman and Brown both also voted to end debate.

In a statement, Cordray said he was honored to be confirmed: “Today’s action brings added certainty to the industries we oversee and reinforces our responsibility to stand on the side of consumers and see that they are treated fairly in the financial marketplace.”

By confirming Cordray, the Senate assured that he can remain in his post for a five-year term, and it effectively ended speculation about Cordray returning to Ohio to seek the Democratic nomination for governor in 2014.

“With Cordray’s confirmation, Ohio and the nation can finally close this chapter and rest safer knowing that Rich is on the job,” said Ohio Democratic Party Chairman Chris Redfern.

Senate Republicans had held up his nomination not because of concerns about the Grove City native’s qualifications or performance, but because they objected to the design of the Consumer Finance Protection Bureau.

They had demanded that his agency be overseen by a five-member board instead of a single director and that Congress finance its operations.

President Barack Obama announced he would nominate Cordray to direct the new bureau two years ago today, but Republicans used Senate rules in December 2011 to prevent a confirmation vote.

So Obama installed Cordray — as well as three members of the National Labor Relations Board — in January 2012 with a recess appointment, a power often used by presidents to fill a vacancy when the Senate is in recess. The Supreme Court is reviewing whether Obama violated his constitutional authority by making the NLRB appointments, and Republicans had argued that Cordray’s counted in those legal challenges. But the Senate vote effectively codifies his role.

Under the deal struck yesterday, Obama will pull the nominations of Sharon Block and Richard Griffin from the NLRB and nominate two others. The Senate will vote on the two replacement nominees quickly, as well as vote on Cordray, EPA administrator nominee Gina McCarthy and Labor Secretary nominee Tom Perez.

Earlier this year, Obama nominated Cordray for the second time. But once again, Republicans threatened to deny Cordray a floor vote. The fight over confirming the nominations had become so contentious that in recent days Senate Majority Leader Harry Reid, D-Nev., had threatened to change the Senate’s filibuster rules to make it possible for a simple majority of the Senate to approve Cordray’s nomination.

The proposal was called “the nuclear option,” and many lamented that changing the rules would destroy Senate tradition and lead to a less collegial body where a simple majority would be able to craft dramatic change. Currently, the Senate needs 60 votes to end debate on an issue before it can proceed to a final vote.

Both sides were so entrenched that the Senate held a rare meeting late Monday to try to work out a deal. Attendees left after nearly four hours seemingly without having done so.

But by yesterday morning, they had a deal.

“It is a compromise, and I think we (Democrats) get what we want, (Republicans) get what they want,” Reid said yesterday. “Not a bad deal.”

Portman had pushed for Cordray to publicly embrace the consumer-agency changes that Republicans want. Yesterday, he said he would introduce a bill to create an inspector general devoted solely to that agency in order to hold it accountable. Under current law, the agency has to share an inspector general with the Federal Reserve.

Portman said yesterday that he was heartened that Cordray has agreed to brief the Senate Appropriations Committee on his agency’s budget. Portman also is pushing Cordray to have the White House Office of Management and Budget conduct a cost-benefit analysis of any new agency regulations.

Brown, meanwhile, called the Senate’s deal “good news,” saying that Republicans’ blocking the nomination “set such a bad precedent. Never in Senate history has it been the case that someone was blocked because they didn’t like the agency.”

He said while “nobody wanted” to change Senate rules to force the nomination, Democrats had originally felt as if they had little choice. “When it really isn’t about the nominees — the Senate can’t operate that way,” Brown said.

The Consumer Financial Protection Bureau was created by Congress in 2010 as part of a major overhaul of financial regulations. The bureau is tasked with helping consumers by requiring financial institutions to simplify products such as home-mortgage loans and credit cards.