RICHMOND — A governor who waffled. Staff members who pushed him to act. Panic under pressure. A wife who was left out.

An unflattering portrait of Gov. Ralph Northam (D) and some of his closest advisers emerged in recent days from the investigation of a racist photo from his medical school yearbook page. While the inquiry did not confirm whether Northam was in the photo, investigators laid bare in excruciating detail how the governor and his staff botched the crisis when the picture came to light.

That fumble risks leaving a permanent stain on Northam’s tenure. Amid internal chaos and confusion, the governor first took the blame for appearing in a photo depicting one person in blackface and another in Ku Klux Klan robes, and then the next day insisted that neither was him. The reversal damaged public trust and raised questions about competence.

“This initial mistake of the . . . messaging, he will not be able to recover from that for the rest of his governorship,” said Marcus Messner, associate director of Virginia Commonwealth University’s school of media and culture. “There will always be a mark because it just created such a believability problem for him.”

The mishandling seems to be the result of a combination of factors. Northam, a pediatric neurologist, is not a natural politician. Many of his closest staff members are young; others had no experience with scandals of a similar magnitude. Making matters worse, the racist photo went to the core of Northam’s self-image as an upright former president of the Honor Court at the Virginia Military Institute.

“He’s not a sophisticated political operator by any means,” said Bob Holsworth, a longtime Richmond political analyst. “They compounded every problem they had — exponentially. . . . It just revealed the inept crisis management mode there.”

Republicans have feasted on the racial component of the controversy — they’ve dubbed Northam “Governor Blackface” and some critics have circulated doctored images of him in blackface on social media. Now they have a new line of attack in a year when all 140 seats in the legislature will be on the November ballot.

“The report really does give me great concern about this administration’s ability to handle a crisis,” House Majority Leader Todd Gilbert (R-Shenandoah) said Friday. “In a situation that should have been the end of his career, he just sat down and did what his staff told him to do without much thought. That’s not leadership.”

Democrats had high hopes of winning majorities in both the state House and the state Senate this fall for the first time in decades. Northam’s troubles make that more difficult. But Holsworth noted that if the party can hang onto the momentum of its recent election cycles, Northam has a shot at being a successful governor.

“He has the possibility of being effective still,” he said. Even while hobbled, Northam managed to work with Republicans to add money to the state budget for at-risk public school students and for affordable housing. And he vetoed a mandatory minimum sentencing bill that African American lawmakers disliked.

If Democrats do manage to take over the legislature, Northam could chalk up big wins in policy areas such as gun control, gay rights and access to abortion. That would come on top of the accomplishments of his first year: expanding Medicaid and landing the second Amazon headquarters.

“The question is, does this impact getting that majority?” Holsworth said.

The meltdown highlighted Northam’s political liabilities in the starkest terms. It was foreshadowed just days before, when he made unclear remarks about late-term abortion that Republicans seized upon to accuse him of favoring infanticide. Northam and his staff declined to clarify or explain his remarks, seemingly stunned that anyone would question his intentions as a physician. That created a vacuum easily filled by opponents including GOP lawmakers and President Trump.

Just two days later, on Feb. 1, someone apparently outraged by the abortion comments tipped off a conservative website to a racist photo on Northam’s personal page in the 1984 Eastern Virginia Medical School (EVMS) yearbook.

According to the investigation conducted by the McGuireWoods law firm on behalf of EVMS and confirmed in interviews with numerous people familiar with the events, Northam saw the photo around 3:30 p.m. on Feb. 1 as he prepared to head to a service for a fallen veteran in Suffolk.

His chief of staff, Clark Mercer, came into Northam’s office with the photo on his iPhone, along with communications director Ofirah Yheskel, 27. Mercer, 39, had been Northam’s chief of staff when he served as lieutenant governor and also had been a policy adviser to U.S. Sen. Mark R. Warner (D-Va.). He told the investigators that he had been waging two days of battles over the abortion comments. “It had been a long week,” he said in the report.

Northam initially said he had no memory of the photo and wondered if it was a hoax. He asked someone to go to the medical school to see if it was in the yearbook, and then left on a state helicopter for the memorial event.

The governor was still in the air when Mercer summoned him back: The photo was real, and reaction was already rolling in.

From that point on, insiders described mounting chaos. Media outlets and lawmakers were calling, texting and emailing, seeking an explanation. Yheskel had left that initial meeting to draft a statement for the governor in which he denied being in the picture, but Mercer wasn’t sure she should.

He huddled with Brian Coy, 35, who had been communications director for the previous governor, Terry McAuliffe (D). Mercer and Coy are close friends, and Coy had stayed in the job for the first few months of Northam’s term before leaving for a Richmond lobbying firm.

Mercer, Coy and other advisers gathered around a single computer and began writing a statement for Northam. The governor stayed in his office, taking calls and meeting with lawmakers and confidants who wanted answers. People who spoke with him came away with different impressions.

Tom King, who had done political advertising for Northam, called the governor while on vacation. “He said, ‘It’s not me. I’m sitting with Pam. We’ve looked at this picture. It’s not me,’ ” King recalled in an interview.

Del. Luke Torian (D-Prince William), who met with Northam along with other members of the Virginia Legislative Black Caucus, pointed to the two people in the picture and asked: “Which one are you?”

Northam told investigators that he responded: “Luke, I can’t answer that. I have no memory of this.”

But Torian’s recollection to investigators was that he said, “I don’t know.”

As demands mounted for a public explanation, the staff consulted a crisis communications firm. Other advisers began converging on Richmond. Mark Bergman, who runs Northam’s political action committee, came down from Connecticut; David Turner, who ran communications for his gubernatorial campaign, traveled from Washington. But they would not arrive until later in the evening.

Mercer and Coy considered three choices: deny, accept responsibility or say Northam was uncertain. They decided the uncertainty route would not fly, given the overheated tone of public attention — the racist photo was beaming nationwide on cable news. They presented Northam with only the first two options.

Northam kept saying he had no memory of it, didn’t think it was him. But he said the worst possible outcome would be to deny it and then have someone come forward to say it was him in the photo. That, Northam said, would ruin his credibility.

So Mercer gave him a written statement accepting responsibility for the picture. Northam approved its release, and later delivered a similar video message.

Later, pressed by the investigators for an explanation, Northam blamed his staff for urging him to respond hastily, definitively — and, he says, falsely.

“My staff is young,” he told investigators. “They work hard, but I haven’t heard anyone say, ‘We should’ve sat down and talked about this.’ That’s not in their playbook.”

But he also acknowledged that he had signed off on the statement.

Mercer later told investigators that he should have paid more attention to what Northam was saying.

“No question that he was in a state of shock that evening,” Mercer said of Northam, according to the EVMS report. “Things could have been handled differently. I wish we had listened a little more intently.”

First lady Pam Northam had left the executive offices earlier in the evening, thinking her husband was going to issue a denial. She had never wavered in her belief that he was not in the picture. When she found out that he took responsibility, she was angry. She demanded that he come home to the Executive Mansion. It was about 10 p.m.

If she had known that staff was going to release the statement accepting responsibility, she told investigators later, she would have “physically stood there and stopped it.”

Much like after the debacle over the abortion comments, Northam and his advisers counted on goodwill from his political allies to provide some cover. They were significantly off base. Every major politician — including Northam’s mentors, McAuliffe and U.S. Sen. Tim Kaine (D-Va.) — called on him to resign.

By the next morning, Northam and his wife had been up almost all night talking with friends and former EVMS colleagues. He was now convinced that he was not in the picture.

Once Northam could sit in a quiet room and think, any doubt or indecision was gone, Mercer told the EVMS investigators. “When he got home, he was a little more clear-headed.”

He stunned his staff members by telling them that he would not resign, and he held a strange, nationally televised news conference in the Executive Mansion to announce that he now disavowed any knowledge of the photo.

He did, however, admit putting shoe polish on his cheeks to imitate Michael Jackson in a dance contest later in 1984. In one moment that later drew sharp derision, a sleep-deprived Northam seemed ready to moonwalk for the cameras until his wife stopped him.

Daniel Palazzolo, a political science professor at the University of Richmond, said the damage done to Northam on a single night in February was in part self-inflicted, a blunder that could have been avoided if the governor and his staff had reacted differently.

“This idea that it was inevitable, that it had to go a certain way — they ruled out the option that made the most sense,” he said. “What if he’d said, ‘Look, I’ve never seen this picture before. . . . I’ll do an investigation and if it turns out that I’m one of the people in the picture, I’ll resign.’ . . . You don’t have to be wishy-washy. Let’s be accountable. But why not be just truthful?”

(Correction: This file has been updated to show the correct party affiliation for Terry McAuliffe (D) and to correct that Gov. Ralph Northam (D) was the former president of the Honor Court at the Virginia Military Institute, not the Honor Guard.)