D.C. United is close to finalizing a multipronged deal to retain goalkeeper Bill Hamid, people familiar with the negotiations said Monday.

Hamid, who turned 29 on Monday, spent the past 1½ seasons on loan from Midtjylland, a Danish club that, should the deal go through, would receive a transfer fee from United of an estimated $750,000.

In late 2017, Midtjylland signed Hamid from United at no charge because his contract had expired. At the time, Hamid had turned down a D.C. extension to pursue an opportunity overseas.

Hamid and United have reached an agreement in principle on a multiyear contract that is likely to make him the highest-paid keeper in the league, said one person, who requested anonymity because some issues remain unresolved.

With Tim Howard ($2.475 million) retiring this fall, Atlanta’s Brad Guzan commands the largest salary ($740,000). Hamid earned $487,000 this year.

Neither Hamid nor United officials responded to messages seeking comment.

Meanwhile, United and center back Frédéric Brillant, who helped anchor MLS’s second-best defense, agreed to a two-year contract, a person unauthorized to discuss the matter said. The Frenchman’s previous deal was set to expire next month.

Retaining Hamid and Brillant were among United’s priorities this offseason, along with signing an attacking central midfielder and retaining left wing Lucas Rodríguez (also on loan this year).

Hamid and Guzan shared the league lead in shutouts (14), and Hamid was third in goals against average (1.12) as he became one of three finalists for MLS goalkeeper of the year honors. (Minnesota’s Vito Mannone won the award.)

The Annandale, Va., native has started 47 of 49 regular season matches since returning in August 2018 from Midtjylland, where he had struggled to earn playing time. He began his pro career with United at 18 and was the primary starter from 2011 to 2017.

Hamid is United’s career leader in shutouts (68) and goalkeeping appearances (231). Among all players, he ranks second in matches behind former forward Jaime Moreno (329).

United has already re-signed backup keeper Chris Seitz and is in talks with third-string Earl Edwards Jr. about a new pact.

Hamid’s return would be a significant boost for United, which lost its two most popular players, captain Wayne Rooney and playmaker Luciano Acosta. Rooney returned to England to serve as a player and assistant coach at second-flight Derby County. Acosta, who lost his starting job this summer amid a disappointing season, is seeking a new home after he and United parted ways this fall.

Acosta wants to play in Europe, but should he remain in MLS, United would receive compensation because it retained his league rights by making a contract offer this year. Multiple Western Conference teams have expressed interest in acquiring him, one person with knowledge of Acosta’s situation said.

Read more on soccer: