Rep. Rob Wittman (R-Va.), right, in January at the State Capitol in Richmond. (Steve Helber/AP)

Rep. Rob Wittman dropped out of the 2017 Virginia governor’s race Thursday, narrowing the field for the GOP nomination.

Wittman said he will stay on Capitol Hill to focus on national security and military jobs in his state.

The Virginia political class has awaited a decision by the five-term congressman since Donald Trump won the White House a month ago, invigorating House Republicans.

Wittman hopes to nab a subcommittee chairmanship that will make him an influential voice on matters involving the military and the Navy, which operates its largest base in Norfolk.

“My intentions haven’t changed,” Wittman said in a statement, “but the circumstances around me have. . . . We have a unique opportunity right now in Congress to work with the new Administration and with Republican lawmakers in the House and Senate to make real impacts across the Commonwealth and the country.”

The announcement leaves three Republicans vying for their party nomination: former GOP strategist Ed Gillespie; Corey A. Stewart, chairman of the Prince William Board of County Supervisors; and state Sen. Frank W. Wagner (Virginia Beach).

Lt. Gov. Ralph Northam is the only Democrat seeking the party’s nomination.

Among Republicans, Gillespie has the most fully formed campaign and the most to gain from Wittman’s exit, because both men appeal to mainstream conservative voters in Virginia — the only Southern state Trump failed to carry.

Calling him “a good friend and a good man,” Gillespie said in a statement that Wittman “has an important opportunity to work with a Trump Administration and our Republican majorities in Congress to advance Virginia’s priorities at a critical time for us.”

Stewart, who was chairman of Trump’s campaign in Virginia for a time, has tried to leverage his association with the incoming administration to woo voters.

Wagner has said that his 24 years in the legislature have prepared him to lead the state.

All three GOP candidates and Wittman are scheduled to speak this weekend at the state GOP’s annual retreat in Richmond.

Gov. Chris Christie of New Jersey and Carly Fiorina, both former GOP presidential hopefuls, will be there, as will Sen. Tim Scott (R-S.C.) and former House majority leader Eric Cantor (R-Va.).

Wittman had been mentioned as a potential candidate in a special election for the Senate seat held by Tim Kaine (D-Va.) if Democrats had won the White House. He has not ruled out running for Senate in 2018, when Kaine’s term ends.

“As a public servant, I believe it’s my job to be where I can do the most good for Virginia,” Wittman said. “I can’t predict where that will be in the future, but right now, it’s here in Congress.”

Wittman’s sprawling congressional district touches parts of Northern Virginia — in Prince William and Fauquier counties — central Virginia and Hampton Roads.

He chairs the House Armed Services readiness subcommittee but would like to move over to the top spot on the subcommittee on sea power and projection forces, where he could have more influence over the nation’s fleet. The Norfolk base is the East Coast home of the nation’s aircraft carriers.

Wittman said Thursday that he has spoken several times with House Speaker Paul D. Ryan (R-Wis.) and Vice President-elect Mike Pence about his decision but that they have not committed to the assignment he wants.

Virginia has been losing influence on military matters as senior members of its congressional delegation have lost seats or retired in recent years.

In 2014, Cantor lost his primary, and Democrat James P. Moran and Republican Frank R. Wolf retired. Reps. Scott Rigell (R) and Robert Hurt (R) declined to seek reelection this year, and Rep. J. Randy Forbes (R) lost in the primary after switching districts.