Gov. Bob Mc­Don­nell (R) scored a major, unexpected victory late Wednesday when both the Democratic-controlled Senate and Republican-led House of Delegates voted to allow him to appoint a seat on the Metro Board of Directors, which he had been seeking since the start of his term.

He had been working for months to get a seat but had been thwarted several times by local officials in Northern Virginia, primarily Democrats, who opposed the effort.

The Senate voted 21-19, with three Democrats — Northern Virginia Sens. Chap Petersen, Chuck Colgan and Toddy Puller — voting with all Republicans. The House voted 62-34.

The amendment to the state’s two-year, $78 billion budget will force the Northern Virginia Transportation Commission, which is comprised of 19 local and state elected officials plus the state’s public transportation director, to give the state one of its seats.

Jay Fisette, NVTC’s chairman, said he was “shocked” the governor pursued the Metro seat through the state budget, noting that the WMATA board and the NVTC were already negotiating with him over the issue.

“By doing it in this way, he’s circumvented the process and done an end run around the ongoing conversations,” Fisette said.