Virginia legislators returned to the Capitol on Wednesday prepared to wade through nearly 1,800 bills and buzzing about another nail-biter election that could tip the balance of power in the Senate.

The high spirits typical of opening day were tamped down at times by the presence of two generally well-liked politicians enduring vastly different personal crises.

Outgoing Gov. Robert F. McDonnell (R), who faces possible indictment over a gifts scandal, kicked off the day at a prayer breakfast and capped it with his last State of the Commonwealth speech. In the address, he reasserted that he provided no favors to the businessman who gave him and family members more than $165,000 in gifts and loans. But he also repeated an apology that he offered the state months earlier.

“While choices I have made have been legal, and as several reviews have shown, no person or company received any special benefits during our administration, I understand that there’s been adverse public impression of some of my decisions or choices that I have made,” McDonnell said. “I have prayed fervently over the last months that the collective good that we have done would not be obscured by this ordeal. So tonight, I say to all of you, and to all Virginians, that I am deeply sorry for the problems and the pain that I’ve caused for you during this past year.”

Another gut-wrenching aspect to opening day came with the reemergence of Sen. R. Creigh Deeds (D-Bath), the Democratic nominee for governor in 2009. It was Deeds’s first public appearance since November, when his mentally ill son stabbed him and then committed suicide after health officials failed to find him a psychiatric bed.

The General Assembly opened its 2014 session with 15 new delegates who were elected in November. The Senate was not up for reelection last fall, but a retirement made room for one new senator, and two seats are about to be vacated — throwing control of the evenly divided chamber into question — because the occupants will move to higher office Saturday.

Legislators spent the first day of their eight-week session dispatching the largely ceremonial business required before they can get to the meaty matters of the year — a two-year, $96 billion budget proposal, ethics and mental health reform, and the proposed expansion of Medicaid under the new federal health-care law.

With the whoops and cheers that are hallmarks of the lower chamber, delegates unanimously and quickly reelected William J. Howell (R-Stafford) as speaker of the House.

“You all obviously haven’t heard committee assignments yet,” he joked.

To applause from some delegates, Howell used his remarks to warn against expanding Medicaid in the state, underscoring the challenge that Gov.-elect Terry McAuliffe (D) will face as he pursues his top goal.

But the speaker also called for bipartisan cooperation, particularly in crafting a budget for the next two years, and he said he would “look forward to working with Governor-elect McAuliffe whenever possible.”

“We should work extraordinarily hard to avoid the partisan gridlock that has distracted our neighbors across the Potomac,” cautioned Howell, whose own priorities are K-12 education, ethics reform and the disbursement of funds from last year’s landmark transportation deal.

On the Senate side of what is often called “Mr. Jefferson’s Capitol,” there was a unanimous vote on an easy matter to find agreement on: getting their staffs paid.

But senators were also bracing for a potential power struggle. The chamber has been evenly split since 2012 but under GOP control because the lieutenant governor, who presides over the chamber and decides most tie votes, was a Republican. On Saturday, that tiebreaking authority shifts from Lt. Gov. Bill Bolling (R) to Lt. Gov.-elect Ralph S. Northam (D).

Northam’s new office, however, gives Republicans a chance to take his seat, and with it outright control of the chamber. After a special election Tuesday, Del. Lynwood W. Lewis Jr. (D-Accomack) led Wayne Coleman (R), the owner of a Norfolk shipping company, by the slimmest of margins: 10 votes out of more than 20,000 cast, according to the State Board of Elections.

That narrow margin — 0.04 percent — entitles Coleman to a recount if the numbers hold. Local election boards began canvassing Wednesday to make sure their results were correct, a process that will continue into Thursday. The elections board is scheduled to meet at 10 a.m. Friday to certify the results, after which the loser could request a recount.

Coleman has not said whether he will ask for a recount, but he wrote on Facebook on Wednesday that he was “committed to ensuring that every legitimate vote cast is fairly counted.”

Republicans have a chance to take another Senate seat, this one being vacated by Attorney General-elect Mark R. Herring (D). Herring’s successor will be chosen in a Jan. 21 special election that could not be called until Herring’s own race — tied up for weeks in a statewide recount — was settled.

If the Democrats hold both of those seats, they hope to reorganize the Senate in ways that will make it easier to control what legislation makes it to the floor and what dies in committee. They will be in for a fight from Republicans, who intend to argue that the Senate was organized for a full four-year term back in 2012.

Attorney General Ken Cuccinelli II (R), who distanced himself from McDonnell during his own gubernatorial campaign last fall, did not attend Wednesday night’s speech. While Bolling, the outgoing lieutenant governor, sat on the dais, and the mention of his name brought a large round of applause, Cuccinelli’s name was met with silence.

Ben Pershing contributed to this report.