The Blue Angels do a flyover during the U.S. Naval Academy graduation and commissioning ceremony at Navy-Marine Corps Memorial Stadium on Friday, May 23, in Annapolis. (Matt McClain/The Washington Post)

She sat on the end of the row in dress whites, periodically smoothing her hair to keep in place a tight bun that the wind seemed determined to undo.

With her white cover tucked beneath her chair, the female midshipman who was at the center of a high-profile sexual assault case listened as Defense Secretary Chuck Hagel spoke about sexual violence in the ranks. He urged the 1,068 graduates to help lead the effort to eliminate sexual harassment and assault from military life.

“We’re all accountable,” he said. “From new recruits to four-star admirals and generals, from second lieutenants to the secretary of defense, we all have to step up and take action when we see something that hurts our people and our values.”

In the eyes of victims’ advocates, the female midshipman stepped up last year when she went public with allegations that she was sexually assaulted by three former Navy football players at a 2012 off-campus party. But not everyone regarded her as a hero. She spent much of the past two years shunned by many of her classmates. And the case she’d been so reluctant to pursue eventually fell apart, with charges dropped against two of the midshipmen and the third acquitted at a March court-martial.

On Friday, the 22-year-old’s long ordeal came to an end at a graduation filled with joy, relief and subtle undertones of awkwardness.

Secretary of Defense Chuck Hagel told graduates that everyone in the military shares responsibility to stamp out sexual harassment and sexual assault in its ranks. (Matt McClain/The Washington Post)

One of the accused midshipmen, Eric Graham, 23, of Eight Mile, Ala., would have graduated Friday, but he agreed to leave the academy after the charges against him were dropped. Members of Graham’s company were the first to collect their diplomas, heading to the stage without their comrade.

His accuser, who was being commissioned as a surface warfare officer, slapped palms with the midshipmen sitting in the row behind her before joining the queue to get her diploma. As she waited to cross the stage, she chatted with company mates. But when her name was finally called, there was a pause, then muted cheers.

After shaking hands with Hagel and Adm. Jonathan Greenert, chief of naval operations, she made her way back to her seat, clutching her diploma with both hands and beaming.

Hagel’s remarks on sexual assault came deep in a speech that emphasized personal accountability and humility. The words acknowledged what everyone present already knew: The struggle to end sexual violence in the military is far from over.

This month, the Pentagon reported that the number of service members who reported being sexually assaulted surged by 50 percent last year compared with a year earlier. While the figures indicated that the problem of sexual assault is more rampant that commanders realized, White House officials said it was also a sign that more people were willing to come forward with allegations. Those figures capped a year that saw a string of high-level officers come under investigation or face courts-martial for sexual misconduct.

“You’ve seen what these crimes do to the survivors, their families, institutions, and communities,” Hagel said. “You know how they tear people and units apart, how they destroy the bonds of confidence and trust that lie at the very core, the center, the heart of our military.”

Naval Academy graduates heard the same message last year from President Obama, who said, “Those who commit sexual assault are not only committing a crime, they threaten the trust and discipline that make our military strong.”

The female midshipman’s allegations surfaced in the media days after Obama spoke. She said that she had been drinking heavily that night and that her memory of it was spotty. The three accused midshipmen said any sexual encounters they had that night with the woman were consensual.

Academy Superintendent Vice Adm. Michael Miller charged them in June. At a preliminary hearing known as an Article 32, the accuser endured more than 20 hours of harsh cross-examination that later prompted lawmakers in Congress to make changes to the Article 32 process. Lawmakers also took away the authority of commanders to overturn jury convictions and added new legal protections for alleged victims of sexual assault.

Charges were eventually dropped against Graham and Tra’ves Bush of Johnston, S.C. The third midshipman, Josh Tate of Nashville, was acquitted in a court-martial. Bush graduated in December and is serving on a ship in Norfolk. Tate, like Graham, agreed to leave the academy.

Their accuser, who tossed her white cover in the air with the rest of her classmates at the end of the graduation ceremony, declined, through an attorney, to be interviewed Friday. Last fall, she told a Washington Post reporter that the case had not “tainted my desire to serve.” And she did not expect it to haunt her. “I’ll leave here,” she predicted, “and people won’t know.”

Some sexual assault survivors believe she has made it easier for others to come forward. However, the latest Pentagon data on sexual assault reports indicates that fewer midshipmen are filing “unrestricted reports” that trigger a criminal investigation. More are choosing to make restricted reports that allow them to access services but do not set off a criminal probe. The proportion of sexual assault reports that are restricted has been steadily increasing over the past decade, Pentagon figures show.

The graduation was the last for Miller, who stressed the importance of an “ethical foundation” upon assuming the post.

Miller subsequently faced criticism and a federal lawsuit over his decisions to send Graham and Tate to courts-martial over the advice of a military judge and his in-house legal counsel. Defense attorneys accused Miller of caving to pressure from higher-ups eager to show that the military was serious about pursuing sexual assault allegations. The superintendent denied that, saying there were reasonable grounds to go forward.

Sen. Kirsten Gillibrand (D-N.Y.) waged a year-long campaign to curtail the role of commanders in the prosecution of military sexual assault cases. Commanders opposed it, and in March, her proposal failed to advance in the Senate by five votes.