Former secretary of state Hillary Clinton greets supporters after participating in a conversation on national security at the Virginia Air and Space Center in Hampton, Va., on June 15. (Melina Mara/The Washington Post)

A wing commander he knew in the Air Force is the sort of man Roy Camp would trust as commander in chief in the wake of an assault on American security as grave as the massacre in Orlando — calm, dependable and a good listener.

Camp says he thinks Hillary Clinton, the presumptive Democratic nominee for president, is qualified to assume that post, too. Her gender is not a concern to him.

“I think she’s the most experienced, yes,” said Camp, 78, who worked in combat support and now lives in Northern Virginia. He has always voted Republican, but his present options have left him uncertain.

Whether voters trust a woman to lead the armed forces has always stood as one of the highest and hardest tests for female politicians, with national security and defense among the areas where gender bias remains most potent.

The anguished days that followed the attack on the Pulse nightclub by a man who pledged allegiance to Islamic State militants have given Clinton a fresh opportunity to make her case that she understands Americans’ fears and can keep the country safe. She has also seized on the response of her Republican opponent, Donald Trump, whose erratic and controversial response to Orlando, as well as the charge that Clinton is weak on foreign policy, have given her ample material to draw a contrast.

Hillary Clinton, the presumptive Democratic presidential nominee, speaks to and meets California voters during a rally in downtown San Jose on May 26. (Melina Mara/The Washington Post)

[Trump and Clinton and their very different responses to the Orlando shootings]

“The fact that she gets to run against Donald Trump helps overcome whatever hurdle there is about a woman being commander in chief,” said Bob Shrum, a Democratic consultant. “He will never be described as steady. That helps her.”

In some ways, the commander-in-chief test is already behind the first woman set to be nominated by a major party to run for president. In Clinton’s first run eight years ago, in part to diminish concerns about sending a woman to the White House, she played down her gender and highlighted her tough stance on security issues. Then came four years as secretary of state, during which she burnished her credentials on foreign policy.

This election, Clinton has chosen a different path, feeling comfortable enough with her national-security acumen to also play up her gender. She regularly celebrates being a grandmother, and she exhorts her female supporters to help her make history and become a lasting role model for girls as the first female president.

The segment of the electorate that is uneasy about the prospect of a female commander in chief is already unlikely to support a Democrat, Shrum said. It includes mostly men, he added — “and I think a collection of men who feel particularly aggrieved” — with whom Trump’s tough stance on immigration and his rebuke of President Obama resonate.

“His base loves it,” Shrum said. “Independent and undecided voters are very troubled by it.”

Her case: Trump is less ready

In a speech after the Orlando massacre, Trump accused Clinton of “true weakness” as he pledged to keep Muslims out of the country. In a dueling speech the same day, Clinton promised to remain vigilant — acknowledging the “barbarity” of “radical jihadists” — while warning against undermining international cooperation as well as the American tradition of tolerance.

Debbie Walsh, director of the Center for American Women and Politics at the Eagleton Institute of Politics at Rutgers University, said the contest between Clinton and Trump has produced a “flip of the gender stereotypes” that has been on prominent display after the Orlando attack. The notion that women cannot be in charge because they are too emotional — “hormonal was the charge back in the ’70s,” Walsh said — and that men are more measured seems to be playing out in reverse as the general election gets underway, she said.

Trump is offering an emotional appeal, Walsh said; Clinton is offering equanimity. It is one more assumption about American political life confounded by this year’s race.

Ari Fleischer, a former White House press secretary under President George W. Bush, conceded that Clinton no longer needs to prove her capacity to be commander in chief. But Fleischer noted that Clinton has plenty of other liabilities, including questions about her honesty.

So does Trump. Unfavorable views of Trump rose to new heights in a Washington Post-ABC News poll released June 15, showing that 70 percent of Americans have a negative opinion of the real estate mogul, compared with 55 percent who view Clinton negatively.

[Negative views of Donald Trump just hit a new campaign high: 7 in 10 Americans]

These numbers suggest that the public’s readiness for a female president has come a long way since the days of Pat Schroeder, the former congresswoman from Colorado who was pilloried for crying when she announced she would not pursue the Democratic nomination for president in 1987. After that, Schroeder kept a file of politicians who cried publicly, including Ronald Reagan, Margaret Thatcher, Mitt Romney, George W. Bush — and recently President Obama at his daughter’s high school graduation.

In an interview last week, Schroeder said the bias is largely generational, as older people did not grow up with women in the military, or perhaps even involved as heavily in such activities as organized sports. Her own view is that the person with access to the nuclear codes must have compassion as much as toughness.

“I think Hillary almost transcends gender on this, having been secretary of state, having been in the Situation Room when the decision was made to go after bin Laden,” Schroeder said. But the obligation, she added, is still to transcend gender, not to embrace it. “It’s hard. It’s still hard.”

In 2015, a report by the Pew Research Center found that 37 percent of Americans believe that men are stronger on national security than women, while 5 percent believe women are stronger and 56 percent say there is no difference.

And Clinton remains weak among men, particularly white men, the group that drove Trump’s primary victories. In the Post-ABC poll, 75 percent of white men said they view Clinton unfavorably. Trump is just as unpopular among women, with 77 percent viewing him negatively — a fact that could offset Clinton’s weakness with men.

Pressure to overcompensate

Camp, who served in the Air Force until 1981, is still figuring out where he stands. Though he may end up voting for Trump because he distrusts a Democrat to handle the budget, he said his own experience, as well as the lessons of history, show that women can be effective military leaders.

“I’ve met some pretty strong women in the military,” he said. “And if you look at Margaret Thatcher in England, she did a tremendous job over there.”

Female leaders across the globe have diminished doubts that women can be effective on the international stage. Thatcher went to war with Argentina over the Falkland Islands, noted Aviel Roshwald, a scholar of authoritarian leadership and global conflict at Georgetown University. Roshwald also cited the severe tactics of Indira Gandhi in India and Golda Meir in Israel.

“This might have played out in the form of overcompensation,” Roshwald said. “There’s undoubtedly, in my mind, a strong impetus for female politicians to be extra tough, to take on an extra macho role in order to counter any such doubts people may have about them.”

Foreign policy is where this impulse is strongest, he said: “It’s the realm where primeval conceptions of masculinity and honor and pride play out most obviously.”

A tough persona was suggested to Clinton in a 2006 memo prepared by Mark Penn, a strategist on her first presidential campaign who recommended that Clinton emulate Thatcher, who was known, Penn wrote, not for “good humor or warmth” but for “smart, tough leadership.”

“We are more Thatcher than anyone else,” he wrote.

[How Hillary Clinton did it the second time around]

Some see Clinton’s actions in the Senate and as secretary of state as an attempt to embody those characteristics. As a senator, Clinton was intent on becoming well-versed in matters of security and national defense, particularly after she joined the Armed Services Committee in 2003, just after the vote to authorize the war in Iraq, which she favored.

In this campaign, she has taken a more aggressive foreign policy approach than Obama, breaking with him, for example, to support a no-fly zone in Syria.

Rep. Tulsi Gabbard, a Democrat from Hawaii and a combat veteran, warned when she endorsed Sen. Bernie Sanders of Vermont for the Democratic nomination that Clinton was too eager to pursue regime change. The libertarian magazine Reason released a video after Clinton effectively clinched the nomination earlier this month, mocking the idea that a female president would bring more restraint to international engagements. It includes a cut of Clinton declaring her victory a “milestone” followed by a collection of women noting sarcastically that it will finally be a woman who “will be in charge of our nation’s secret kill list” and a woman who “helps destabilize the Middle East.”

Still, even as Clinton presented herself as a hard-nosed diplomat, said Walsh, who studies women’s participation in politics, she made a point of emphasizing women and children in her foreign travel. One lesson of her failed campaign in 2008, Walsh said, was that she could have gravitas on foreign policy while also “embracing the gender component.”

Fleischer noted that Clinton was probably overcompensating when she falsely claimed in 2008 that she had landed in Bosnia in 1996 under sniper fire. He does not see her doing that this year — nor needing to. “She’s using gender more for the case that she’s a change agent,” he said.

Karen Tumulty contributed to this report.