President-elect Donald Trump, center, stops to talk to reporters during a tour of the U.S. Capitol on Thursday with his wife Melania, left, and Senate Majority Leader Mitch McConnell (R-Ky.), right. (Bill O’Leary/The Washington Post)

Nowhere did Donald Trump’s candidacy inspire more trepidation or alarm than in the national security community, inhabited by many Republicans who vehemently denounced their party’s nominee as dangerously unfit to be commander in chief.

Now, as President-elect Trump begins assembling his government, scores of former senior national security officials, foreign policy specialists and career civil servants are wrestling with a dilemma: refuse government service or join the administration of the 45th president?

Whether these seasoned experts step forward to help — and whether Trump accepts them into his administration — will send a powerful signal about the new president’s intentions and ability to broaden his sphere of influencers beyond the loyalists who helped steer him to an improbable triumph in the election.

“I think it’s time for the intelligence guys to be professional and to suck it up,” said Charles Allen, who served nearly five decades in the CIA and is the unofficial dean of former intelligence community officials. “We work for the president and the Congress, and that’s all we do. We’re capable, and we have to do our job.”

While most pronounced in the national security realm, this dynamic is evident throughout Trump’s transition, which is tasked with filling about 4,100 federal jobs. Washington’s officialdom is waiting with nervous anticipation for Trump’s first appointments, especially those in the West Wing who would serve as the president’s gatekeepers.

During his campaign, President-elect Donald Trump repeatedly vowed to "drain the swamp" in D.C. and rid the federal government of political elites and lobbyists. But just days into his transition to president, Trump seems to be doing the opposite. (Deirdra O'Regan/The Washington Post)

Does the president-elect install as White House chief of staff a broadly acceptable insider such as Republican National Committee Chairman Reince Priebus, who was recommended by House Speaker Paul D. Ryan (Wis.)? Or does he choose an antagonistic ideologue — perhaps Stephen K. Bannon, the Trump campaign chief executive who assailed the congressional leadership as chairman of Breitbart News?

Does he tap a sober-minded consensus choice such as Sen. Bob Corker (Tenn.) as secretary of state or a combustible Trump confidant such as former New York mayor Rudolph W. Giuliani or former House speaker Newt Gingrich, who are both said to be eyeing the diplomatic post? Does Trump appoint industry lobbyists and forsake his pledge to “drain the swamp” of special interests?

“Personnel is policy,” said Scott Reed, a Washington establishment fixture and the U.S. Chamber of Commerce’s top political strategist. “We’re going to be watching those first couple of appointments. It will set the tone on what kind of relationship the president-elect will have with the town.”

Trump campaign manager Kellyanne Conway said Saturday that a chief of staff announcement was “imminent,” telling reporters that Priebus was interested in the job and is one of several candidates Trump is considering.

So far, Trump has sent mixed signals. He selected Vice President-elect Mike Pence, who is regarded as an advocate of inclusion and a bridge to the Washington establishment and conservative think tanks, to lead the transition. He has populated his transition teams with experienced hands for areas including national security, intelligence and military.

“You don’t want to get in an echo chamber, where you only have ‘yes’ people and you don’t have any contrary thinking,” said former Republican congressman Benjamin Quayle.

The Post’s Marc Fisher explains how some of President-elect Donald Trump’s traits could inform his leadership style when he takes office. (Bastien Inzaurralde/The Washington Post)

Trump’s advisers said the president-elect is mindful of the importance of cultivating strong relationships with the Republican-led Senate and House to pass his ambitious agenda, including a tax overhaul and a sweeping infrastructure program.

To that end, he tapped Rick Dearborn, a former chief of staff to Sen. Jeff Sessions (R-Ala.) who is well known to lawmakers, as transition director. And Eric Ueland, a veteran Senate staffer who runs the Senate Budget Committee, has been mentioned as a likely pick to head Trump’s Office of Management and Budget.

There is talk among people familiar with the effort that Trump is open to tapping a Democrat to fill at least one Cabinet position — perhaps as secretary of transportation, a nonideological post for which President Obama chose Republican Ray LaHood and George W. Bush chose Democrat Norman Y. Mineta.

Congressional Republicans, meanwhile, seem to be swooning at the unexpected opportunity to govern, though they could easily become alienated.

“I’ve been on the phone with giddy Republicans for about 48 hours now,” Rep. Tom Cole (R-Okla.) said. “Everybody assumed we’d come back and be the firewall [against a President Hillary Clinton], and now we see the opportunity to be the point of the spear.”

‘It’s their duty’

Some of the Republican national security figures who signed a public letter condemning Trump during the campaign said they would never serve in his administration, and they could be blacklisted anyway. But even they have been counseling others that serving might be the right thing to do for the country.

As the seriousness of governing subsumes the vitriol of the campaign, a dozen national security experts interviewed said they believed experienced people will resume their roles as apolitical professionals and be willing to join the administration.

“I know many of those people, and some would be sufficiently patriotic to think it’s their duty,” said Jeffrey H. Smith, former CIA general counsel and head of Arnold & Porter’s national security law practice. “It’s just too important.”

Eliot Cohen, who served as counselor to former secretary of state Condoleezza Rice, was a driving force behind an open letter last spring, eventually signed by 122 Republican national security leaders who opposed Trump’s candidacy and pledged not to serve in a Trump administration.

In an essay titled “To An Anxious Friend,” published Thursday in the American Interest, Cohen advised career military, diplomatic and intelligence officials to “continue to do their jobs.”

“The government has to be staffed,” wrote Cohen, who is director of the strategic studies program at the School of Advanced International Studies at Johns Hopkins University.

Those accepting, he wrote, should understand the limits of their influence and the extent to which the administration is “likely to be torn by infighting and bureaucratic skulduggery.” They should say yes, he said, “with two conditions . . . that they keep a signed but undated letter of resignation in their desk . . . and that they not recant a word of what they have said thus far.”

Susan Hennessey, a fellow at Brookings and former attorney at the National Security Agency, said many of her friends who are career national security officers are trying to decide whether to remain in their jobs.

“If you are a person who believes that Donald Trump threatens the very institution and poses a real threat to American security abroad because he is inexperienced and undisciplined, is it your duty to not participate or is it your duty to serve in hopes of providing him wise counsel?” she asked.

The leadership of Trump’s national security transition team includes former Republican officials and retired military officers well within the boundaries of the conservative mainstream.

The team is headed by former Army lieutenant general Ronald L. Burgess Jr., a previous Defense Intelligence Agency director, and Mike Rogers, a former House Intelligence Committee chairman. Other players include retired one-star general Michael Meese, a protege of David H. Petraeus in Iraq and Afghanistan; Mira Ricardel, a veteran of the Pentagon; retired lieutenant general Keith Kellogg, an early Trump supporter; and James Carafano, another retired military officer.

Others, particularly among those who have been active on Trump’s campaign, have engendered more skepticism. Since the election, some have already made policy statements causing concern — and creating uncertainty as to whether they are speaking for the incoming administration.

Michael T. Flynn, the retired three-star general who often served as a Trump surrogate and a member of the 16-member top advisory group, on Election Day criticized Obama’s policy on Turkey, a key but troubling ally in the fight against the Islamic State.

The United States, Flynn said in an opinion column published in the Hill, should show Turkey who its “real friends” are by extraditing the U.S. resident and Muslim cleric responsible, according to Ankara, for last summer’s coup attempt there. Because Turkey is such a crucial ally, Flynn wrote, the U.S. government should also stem its official criticism of the country’s crackdown on perceived political opponents.

The Obama administration has said there will be no political interference in the Justice Department’s consideration of Turkey’s request to extradite Fethullah Gulen.

On Thursday, Jason Greenblatt, named by Trump as one of his top advisers on Israel, said in Israeli radio interviews that the president-elect does not view Israeli settlements on Palestinian land as “an obstacle to peace.” Trump says the United States should not impose its own views on the issue, Greenblatt said, and should leave the two sides to work it out themselves.

U.S. policy under Obama has been sharply critical of the expanding settlements, which have been internationally condemned as illegal.

Trump is widely expected to reward his loyalists with plum posts. People familiar with preliminary talks said Giuliani is said to favor secretary of state but also is under consideration for attorney general and secretary of homeland security. New Jersey Gov. Chris Christie also is in the mix for attorney general and secretary of state, as well as commerce secretary. And Gingrich could end up in any of a wide range of roles across foreign or domestic policy.

‘Managers and ideologues’

One factor contributing to the uncertainty is that the transition’s center of gravity is not in Washington, where the government provides office space, but at Trump Tower, the president-elect’s midtown Manhattan skyscraper. His three oldest children — and especially his son-in-law, Jared Kushner — are exerting great influence over the early deliberations, as are many of his campaign loyalists, including Bannon and major donor Rebekah Mercer.

Darrell M. West, who heads governance studies at the Brookings Institution, said what he sees so far from the Trump transition is “schizophrenia. . . . When you look at the names being floated, it’s a mix of managers and ideologues.”

In his transition’s first week, Trump has not announced any appointments. In 2008, President-elect Barack Obama named his White House chief of staff — then-Rep. Rahm Emanuel (D-Ill.) — two days after the election.

Trump’s transition team, which had been led by Christie, has been at work since the summer. But many members did not expect Trump to win and are only now delving into the serious work of assembling the administration and mapping out a detailed agenda to launch after Trump’s Jan. 20 inauguration.

“It’s like the dog chasing the bus and we’ve finally caught it, so now we have to figure out what to do,” said one Trump adviser, who spoke on the condition of anonymity because transition talks are confidential.

For Trump, history offers different guides. President Ronald Reagan reached outside his inner circle of ideological Californians and brought in pragmatist James A. Baker III, who had run two primary campaigns against him, as his White House chief of staff.

President Bill Clinton staged a splashy transition, promising a Cabinet that would “look like America.” But in the end, he stacked his White House with longtime friends — Thomas F. “Mack” McLarty III, a kindergarten classmate, became chief of staff — and went on to have a chaotic first year.

The first glimmer of how President George W. Bush’s administration would run came when he empowered his No. 2, Richard B. Cheney, to assemble the government. With the outcome of the 2000 election still in doubt pending a Florida recount and a Supreme Court ruling, Cheney did so from the kitchen table at his townhouse in McLean, Va., and populated the administration with his own allies.

Meanwhile, Obama, anxious to avoid Clinton’s mistakes, worked from the inside out. He put much of his early focus on filling jobs in the White House, led by the wily Emanuel, which foreshadowed a tightly centralized presidency.

Karen Tumulty contributed to this report.