Pat Onstad tries his best but Omar Cummings of Colorado, far right, heads a goal past him in a game earlier this season. Onstad, 43, was playing despite joining D.C. United as an assistant coach. (Doug Pensinger/GETTY IMAGES)

When Pat Onstad decided in December to end his 23-year playing career and enter the coaching ranks, he couldn’t say a proper farewell to the Houston Dynamo’s supporters.

It was MLS’s offseason, and he had received an offer to become D.C. United’s goalkeepers coach. There was no formal occasion to say goodbye after five years and two league championships. Before the Dynamo moved to Texas from San Jose, Onstad had served three years in the organization and helped the Earthquakes win a title.

On Friday night, when his old team hosts his new team at Robertson Stadium, the Dynamo will provide a fitting send-off. Onstad’s wife and three children will be at his side during a postgame ceremony.

Given the unusual arc of his first few months with United, the timing is perfect: After being thrust back into active duty, Onstad, 43, is essentially retiring as a player again this week.

Because of United’s injury bug in preseason, he became an emergency replacement. But with Bill Hamid settling into the starting role and Steve Cronin back from a broken wrist, Onstad’s playing services probably won’t be needed again.

“I’ve enjoyed it,” he said, “but I feel like it’s time.”

Serving in a player-coach role, Onstad started the first three regular season matches and became the backup when Hamid returned from shoulder rehabilitation.

On Tuesday, with United in a hectic stretch and Hamid needing a break, Onstad made what was likely the final appearance of his prolonged career, starting in a 3-2 loss to the New England Revolution in a U.S. Open Cup qualifier.

Onstad showed leadership and inspiration, but admittedly also showed his age. Aside from a few classy saves, he wasn’t able to replicate his golden years in MLS and with the Canadian national team.

“I had a taste but I’m just disappointed I couldn’t do more, make a few more big saves and perform at the level I’ve shown in the past,” said Onstad, the oldest player in league history. “Is the door closing? Yeah. And I haven’t done myself any favors. The whole idea was to protect Bill as long as we could, and he is definitely ready to go.”

Barring another significant injury to the goalkeeping corps, United will allow Onstad’s month-to-month playing contract to expire at the end of May and let him focus on coaching.

“It’s heartwarming, seeing him still playing,” said Hamid, 20, who was born 2½ years after Onstad debuted for Canada in international play. “He’s the chief, the big guy on campus.

“From the first day he arrived, without saying anything, he threw out his knowledge by the way he played: his positioning, his confidence, his leadership. And that gives you the confidence to model your game after his.”

Initially, Onstad accepted United’s offer without any intention of playing again. He had toiled for years in lower-tier Canadian and U.S. circuits and spent time in Scotland before jumping to MLS in 2003. Twice he was voted the league’s best goalkeeper.

In December, when Ben Olsen was appointed United’s head coach, he extended an offer to Onstad, who was nearing the end of his career. Mark Simpson, the team’s longtime goalkeepers coach, was pursuing other opportunities, and Olsen needed a seasoned mentor for Hamid.

Hamid had undergone shoulder surgery in the fall and wouldn’t be available until after the season began. Nonetheless, United was comfortable with Cronin in the lead role. But when Cronin broke his wrist at training camp in Florida, Olsen turned to Onstad.

In practice sessions, Onstad both readied himself for action and oversaw the goalkeeping corps, which also includes rookie Joe Willis.

“He’s still teaching and putting their development in the forefront,” Olsen said. “He’s ready to go, but he’s ready to teach.”

As an assistant, Onstad is “a very honest guy — he has that Canadian honesty — and he keeps me on my toes,” Olsen said.

Returning to Houston is “going to bring mixed emotions,” Onstad said. “I spent some great times with a lot of those guys on the other side.”

Using the visitors’ locker room will also seem strange.

“The only time I’ve been in there,” he said, laughing, “was for the league’s drug-testing.”

United notes: The results of an MRI exam on midfielder Branko Boskovic’s left knee were negative and he might be able to play. Boskovic, the club’s most influential player the past two matches, left Tuesday’s game in the 85th minute after scoring twice. . . .

United is 0-4-1 and has scored in just one visit to Houston. . . . The Dynamo is unbeaten in five straight since a season-opening loss to Philadelphia.