TIM KAINE is quietly returning to the office he, and nearly everyone else, thought he would give up to become vice president.

After the unanticipated Democratic catastrophe of 2016, Mr Kaine is still a United States senator, representing Virginia, the only state in the Old Confederacy won by his presidential running mate, former Secretary of State Hillary Clinton.

Serving his first six-year term, Mr Kaine, who says he has no interest in running for president in 2020, has two years until he stands for re-election to the Senate. It is not a lot of time, but enough perhaps for Mr Kaine—having recently established a national profile—to establish himself as a counterweight in the Senate to the new Republican president, Donald Trump.

“There is a lot of work to do to make Congress the branch that it is meant to be,” Mr Kaine told his hometown newspaper, the Richmond Times-Dispatch, in a recent interview. “In terms of where there is the most need for good to be done, I think it’s here,” he said, adding, “I’ve built very, very good relations, even in a short time, with Republican members in the Senate and some in the House side… I kind of have a sense of vocation… of the work that needs to be done to improve this branch. And I think that’s my highest and best use.”

In the Senate, the issues on which Mr Kaine might challenge Mr Trump, and perhaps even put him under pressure to compromise, could include one that brought him to the attention of Hillary Clinton’s campaign: a proposed rewrite of the rules under which America goes to war. His collaborators include John McCain, Arizona senator, Vietnam era prisoner of war and two-time Republican presidential candidate.

For Mr Kaine, it is an issue that, at its core, demands Congress fulfill its constitutional responsibility to declare war. Mr Kaine’s insistence that the Congress vote up or down on Barack Obama’s military adventure in Syria initially put him at odds with his friend and fellow former community organiser in the White House. But even Mr Obama came around, using his state of the union address in 2015 to urge a congressional vote.

“Protecting the institutional powers of an unpopular institution was never the formula to give Mr Kaine the big national spotlight,” Mark Rozell, an analyst at George Mason University who monitors Virginia politics, wrote in a recent commentary. “Yet he took on this enduring critical issue anyway. With the election to the presidency of a candidate who has made bold claims of how presidents should lead regardless of countervailing forces, Kaine now is positioned to be a credible and leading institutional defender in the Trump era.”

To observers such as Mr Rozell, this is an indication that, in defeat, Mr Kaine has an opportunity to restore his pre-election brand as the cheerful problem-solver who, in politics, sees only possibilities. During the national campaign, Mr Kaine occasionally came across as a snarling partisan hit-man, mostly interested in lancing Republicans. This was on full display during his vice presidential debate in October with his opponent, Mike Pence. For most of the encounter Mr Kaine was seen as petulant, even impolite.

Mr Kaine has top-tier committee assignments, sitting on Armed Services and Foreign Relations. This enhances his credibility in the war powers debate, particularly if the inexperienced Mr. Trump attempts to commit, by executive fiat, American blood and treasure to another of the world’s trouble spots.

These committee berths are prized for home-state political reasons, too. Virginia is a defence-rich state, with such marquee assets as the Pentagon, in Northern Virginia outside Washington, DC and the Norfolk Naval Base, at Hampton Roads, the world’s largest natural harbour, in the southeastern corner of the state. Scattered in between are army, air force and Marine Corps bases. The military is a powerful economic engine for Virginia as well as an important manifestation of the nation’s influence. Mr Kaine can protect both, serving on those prized committees—perhaps in the process helping himself politically for what could be a perilous re-election campaign.

Mr Kaine’s Senate seat is among 33 that will be decided in the 2018 elections, the first congressional midterm contests of Mr Trump’s four-year term. Though the party controlling the White House typically loses seats, a disproportionate number in the Senate—23—are held by Democrats.

Mr Kaine’s seat would be a special prize for Republicans, who could depict his defeat for re-election as a final repudiation of Mrs Clinton as well as eliminating him as a national contender should his change his mind and seek the presidency in four years.

As the state Republican chairman, John Whitbeck, sees it, “After the voters of Virginia go to the polls in 2018 to weigh in on [Mr Kaine’s] dramatic abandonment of virtually everything he’s ever stood for to be Hillary’s running mate, it would be very difficult for then-former Senator Kaine to get any traction at all.” Mr Kaine appreciates the risks that he could face in 2018, having seen the state’s supposedly unbeatable senior senator, Democrat Mark Warner, barely survive in 2014 for a second term against Republican Ed Gillespie, a Washington fixer now running for governor in 2017. Mr Warner’s close call is attributed to the lower turnout of an off year that magnifies the voting strength of the Republican base of older, white conservatives.

Republicans could have no shortage of challengers to Mr Kaine, who was easily elected to his first term in 2012, when Mr Obama topped the ballot. However, goodwill from Mr Kaine’s governorship, which ended in 2010, and a weak Republican nominee, allowed him to run more than 200,000 votes ahead of the president.

Prospective Republican opponents include Carla Fiorina, the corporate executive-turned-presidential candidate and Rob Wittman, a congressman toying with a gubernatorial bid that could be junked if he lands the chairmanship of a House seapower subcommittee important to Virginia. The most potent challenger could be a Republican survivor: Congresswoman Barbara Comstock, re-elected to a second term in a swing district in the Washington suburbs. She refused to endorse Mr Trump; even demanded that he relinquish the presidential nomination to Mr Pence after the release of the 11-year-old video in which Mr Trump boasted crudely of groping women.

In other words what backfired for Mr Kaine worked like a charm for Ms Comstock: running against Mr Trump.