Virginia lawmakers soundly rejected many of Gov. Robert F. McDonnell’s key amendments to the state budget Monday, on a day when the Republican governor bucked conservatives who were trying to derail the appointment of a gay judge.

The General Assembly returned to the Capitol to vote on more than 100 amendments that McDonnell had proposed to current spending as well as the two-year, $85 billion budget that starts July 1, and to appoint as many as 41 judges across the state.

Work on the budget stretched late into the night. Only after that work was wrapped up would legislators turn to judicial appointments — a matter that had become contentious in recent days as conservatives pushed to reject the appointment of a Richmond prosecutor who has been outspoken on gay rights issues.

The House of Delegates slogged through McDonnell’s amendments for about eight hours — rejecting 26 by unanimous or near unanimous votes. The Senate struck down another five, including one that would have allowed the governor to divert surplus general funds for transportation. And then both chambers took up the judicial appointments, which had not been decided by press time.

“The number of proposed amendments that were rejected was probably more than I’ve seen at any session,” said Del. Lacey Putney (I-Bedford), a 50-year veteran of the House who caucuses with Republicans and chairs the House Appropriations Committee. “But I can’t say that I was much surprised.”

Del. Mark Sickles (D-Fairfax) said the governor, who opened this year’s legislative session cautioning fellow Republicans not to overreach, tried to do just that with his amendments.

“He just went several steps too far,” Sickles said. “I guess he expected the Republicans to fall in lock step. It was the most bipartisan day of voting in my nine years down here.”

McDonnell did not make himself available to reporters, but his office issued a statement late Monday night that said in part that 72 percent of the governor’s amendments had been approved. “[I]t is unfortunate that the General Assembly also rejected several important amendments that would have helped with our ongoing effort to control state spending and make state government more efficient and effective,” the statement also read.

The state budget has been delayed by partisan wrangling over Senate committee assignments and funding for a project to extend Metrorail to Dulles International Airport. McDonnell made relatively modest changes to the budget this month, but legislators weren’t having much of it.

The governor had submitted $43.9 million in amendments, some of them directing more funds to education and economic development, including adding $2 million to lure filmmakers to Virginia.

McDonnell prevailed on the movie industry money, over the objections of Del. Scott Surovell (D-Fairfax), who held up an E.T. doll to argue that affluent filmmakers didn’t need a break from the state. “E.T. can phone home, but he can do it on his own dime,” Surovell said.

The movie incentives also surived a vote in the Senate.

The House killed a budget amendment that state lawmakers said would withhold $150 million already approved for the authority overseeing construction of Metro’s multibillion-dollar planned extension to Dulles.

The amendment appeared to withhold the money until Virginia’s two new members are seated on the Metropolitan Washington Airports Authority’s board. Transportation Secretary Sean T. Connaughton denied last week that the amendment threatened funding, calling legislators and their staff members “idiots” for saying so. It ultimately failed because of a major wording error, pointed out on the House floor. As it read, the amendment would have withheld funding not just from the rail project, but also all of state government for the current fiscal year.

The House unanimously rejected an amendment that would have made it harder for state employees to receive a one-time, 3 percent bonus. The bonus will be paid if unspent balances at the end of the current fiscal year are large enough to cover the cost. McDonnell had wanted the bonuses to be paid only if the balances were 1.5 times the cost.

Once it completed its work on the budget, the General Assembly then took up the appointment of judges. A conservative state delegate was vowing to fight the appointment of an openly gay man as a General District Court judge in Richmond.

Del. Robert G. Marshall (R-Prince William), who is running for U.S. Senate, said he would seek to remove the name of “homosexual activist” Tracy Thorne-Begland from the list of 41 nominees for judgeships that lawmakers would consider appointing.

Thorne-Begland, Richmond prosecutor for the past 12 years, came out as a gay Navy officer on national television 20 years ago to challenge the military’s now-abandoned “don’t ask, don’t tell” policy. A former board member of the gay rights group Equality Virginia, he has since spoken out in favor of same-sex marriage. He and his partner, a Richmond lawyer, are raising twins.

Marshall called him “an aggressive activist for the pro-homosexual agenda.”

Asked about the governor’s position, spokesman Tucker Martin said in a statement: “The Governor believes candidates for judicial vacancies must be considered based solely on their merit, record, aptitude and skill. No other factors should ever be considered and the Governor has long made clear that discrimination on the basis of sexual orientation is not acceptable in state government.”

Thorne-Begland declined to comment over the weekend, saying it would be improper for him to do so as a judicial nominee.

His sponsor in the House, Del. G. Manoli Loupassi (R-Richmond), said that Thorne-Begland was “absolutely well qualified” for the post and that his public statements about gay rights did not diminish his fitness for the bench.

Loupassi noted that two former delegates who’ve made their own public statements on a variety of political issues — C.L. “Clay” Athey Jr., a Republican from Warren; and Clarence E. “Bud” Phillips, a Democrat from Southside — are also among the nominees.

Loupassi also said questions about gay rights are not likely to come before a General District Gourt judge, who decides guilt and innocence in misdemeanor cases and probable cause in felony cases.