Brian Green’s evening played out with ordinary pleasantness that day in April 2009: He coached a soccer game in suburban Maryland. Then he had a leftover taco dinner.

Hours later, fast asleep, Green, the counterpiracy branch chief at the Office of Naval Intelligence, got a phone call he’d known might come someday. The ONI’s watch center in Suitland was on the line to tell him that for the first time in recent memory, a U.S.-flagged container ship — the Maersk Alabama — had been hijacked by pirates.

“To be pretty frank, these were words I dreaded to hear,” recalled Green, 35. “From there, I knew the game was on.”

On Thursday, 21 / 2 years since the Maersk Alabama was attacked by four Somalis in a drama that played out over five days and ended in no American deaths, the anonymous band of intelligence analysts who helped in the rescue was given a formal thank-you from the Maersk Line, the ship’s Norfolk-based operator.

In a ceremony at the agency’s headquarters, Steve Carmel, Maersk’s senior vice president of maritime services, unveiled a four-foot copy of the Maersk Alabama, a token of appreciation that will remain in Suitland. The Maersk model will join several other models of historic boats from wars that occupy space at the intelligence installation.

The presentation offered a rare glimpse of the secretive work of the ONI’s counterpiracy branch, a group of mostly civilian intelligence analysts who monitor 2.8 million square miles of water — spanning from the Horn of Africa to the west coast of India to south of Madagascar — and alert commercial ships to nearby pirates.

In the event’s aftermath, Navy SEALS reaped so much of the glory because their snipers shot and killed three of the four pirates, enabling the rescue of Richard Phillips, the Maersk captain. (Phillips’s book “A Captain’s Duty: Somali Pirates, Navy SEALS, and Dangerous Days at Sea” is being made into a movie starring Tom Hanks.)

But Thursday was meant to honor the desk-bound intelligence analysts, whose work is quiet but no less important.

Initially during the ceremony, the counterpiracy analysts — mostly men and one woman who live in the Washington region — posed behind the model ship for photographs. But they were rushed off before the official unveiling because they were not allowed to be photographed by the media and have their faces known publicly. They wore suits. A couple sport goatees.

In his speech while accepting the red, gray and yellow boat, the ONI’s commander, Capt. Robert Rupp, exuded some swagger on behalf of his unassuming charges.

“This event involved 20 different agencies. . . . The fact that ONI was selected to be the lead is because we are the experts,” he said. “You can’t turn to the . . . CIA or NSA to understand the unique issues of what happens under the water, on the water, or over the water.”

The night he was woken up, Green said he first called Steve Carmel, Maersk’s vice president of maritime services.

The men had communicated frequently about potential piracy threats, and they share a bond: Both are graduates of the U.S. Merchant Marine Academy in New York.

They speak the jargon of the commercial shipping business — a timesaver.

“I was just standing in the middle of my room in my underwear, saying, ‘Steve, I need as much information as possible,’ ” Green recalled. “Steve was able to provide us with the ship’s crew and its position.”

The son of a retired police officer from Upstate New York, Green had anticipated such a moment. After the Sept. 11, 2001, terrorist attacks, he left his marketing position with a shipping and railroad company to work first at the Defense Intelligence Agency, then at ONI.

At the Suitland headquarters, Green learned that while the rest of the Maersk crew was hiding on their container ship, the Somalis had taken Phillips hostage in Maersk’s own lifeboat, drifting not that far away — a departure from standard piracy operating procedure.

Typically, Somali pirates bring the hijacked merchant ship and its crew back to the Somali shoreline, where they can anchor safely, Green said.

“This was a game-changer,” he remembered thinking.

Soon, the pirates began demanding millions of dollars in ransom and safe passage in exchange for the 53-year-old captain’s release. Finally, the USS Bainbridge, carrying Navy SEALS, arrived on the scene.

Back in Suitland, Green and his team were feeding military commanders information about the orange lifeboat where Phillips was being held. During their time at the academy, Green and the two others had trained in one of those lifeboats.

“We knew the positions of the boat’s hatches,” Green said, “and how they would open.”

Out in the ocean, the pirates were running out of fuel. The weather rocked their boat, and they agreed to let the Bainbridge tow them to safer waters. Now the lifeboat was about 80 feet from the warship.

When the SEAL snipers saw two pirates peek their heads out of a lifeboat hatch — and a third pirate point his AK-47 at Phillips’s back — they fired off three rounds. Phillips was saved.

A year-and-a-half later, in November 2010, Green happened to be testifying in a piracy trial in federal court in Norfolk, where the Maersk Line is based and where the executive Carmel works.

He stopped by the office to say hello and noticed the brightly colored model ship of the Maersk Alabama.

“I just said, ‘That’s a nice model,’ ” Green recalled. “And Steve said, ‘Well, we should get one to you guys in appreciation for what you did.’ ”