All forces seemed to conspire against D.C. United on Sunday at Audi Field.

Wayne Rooney was home sick after a week in which he announced he would not return next season. The mixed lineup — with a newcomer, players out of normal position and starters missing because of injury — was on its heels almost all night against Zlatan Ibrahimovic and the Los Angeles Galaxy.

Possession was fleeting, and scoring opportunities were elusive.

But with the season slipping away, United mustered the effort and courage — not to mention two goals against the run of play and sterling goalkeeping by Bill Hamid — to escape with a 2-1 victory before a sellout crowd of 20,006.

Lucas Rodriguez scored the go-ahead goal in the 73rd minute as United (10-7-9) won for just the third time in 14 matches and rebounded from the previous weekend’s 5-1 home thumping against first-place Philadelphia.

“The effort and the commitment from that group was terrific — as good of a group effort as we have had all year,” Coach Ben Olsen said. “Sometimes that is enough. Tonight it saw us through.”

When the final whistle sounded, players dropped to their knees and pumped their arms. For all the problems this team has endured this summer, Sunday’s victory brought a wave of energy and excitement.

“Sometimes it is going to be like today — the fight, the mentality and give the best we can,” said defensive midfielder Felipe Martins, who arrived this past week in a trade with Vancouver. He went the distance and was among several players who performed admirably under duress.

With Martins combining with Quincy Amarikwa, who started for Rooney, United showed more bite than it had in recent matches. Paul Arriola was all over the place and scored the first goal.

The defensive unit kept bending but did not break, withstanding Ibrahimovic’s menacing presence and the Galaxy’s 70 percent of possession. And Hamid was sensational, making save after save after conceding Favio Alvarez’s equalizer early in the second half.

United also was without playmaker Luciano Acosta, whom Olsen benched for ineffective play. Olsen ended up making no substitutions, leaning on his 11 players to hold on.

“Risking the fatigue for the familiarity out there,” he explained. “Sometimes it bites you in the ass, and tonight I got away with it.”

Rooney and Acosta were not the only absences. The three primary defensive midfielders (for two starting slots) were all unavailable: Russell Canouse and Chris Durkin (injuries) and Junior Moreno (red-card suspension).

Olsen would have liked to have started Norwegian striker Ola Kamara, a proven MLS scorer who returned to MLS this past week after a short stint in China. He has not received a work permit, however.

The Galaxy (12-11-1) had no such problems activating Cristian Pavon, an Argentine World Cup midfielder signed on loan from Boca Juniors before the MLS transfer and trade deadline closed Wednesday. Starting on the left wing, he created havoc with his ball skills and unpredictability.

Given the personnel on both sides, Los Angeles predictably dominated possession. United absorbed unrelenting pressure and waited for its moment, through set pieces or counterattacks.

It came in the 28th minute, an end-to-end sequence accomplished with five touches of the ball. Hamid drove it into the Los Angeles end. Amarikwa won the header. Ulises Segura chested the ball down and flicked it behind the defense. On the run, Arriola volleyed past David Bingham for his fifth goal.

United thought it had another one 15 minutes later, but Rodriguez’s put-away of Bingham’s save on Arriola was correctly ruled offside by the video assistant referee.

Hamid preserved the lead in first-half stoppage time, making a terrific hand save on Uriel Antuna’s 10-yard shot through traffic.

United’s good fortunes ended three minutes into the second half. Antuna crossed toward Ibrahimovic. Jalen Robinson intervened. The ball fell nicely for Alvarez, who placed a 17-yard one-timer into the low left corner.

D.C. rarely enjoyed possession in the second half. Amid the defensive stance, right back Robinson and left back Joseph Mora were injured within seconds of one another and required medical attention. Both stayed in the game.

The pressure continued. Hamid made a sensational reflex save on Ibrahimovic’s full volley from eight yards.

United kept its cool, and against the run of play and against the odds, it reclaimed the lead.

Bingham stopped Segura’s 25-yard bid, then blocked Arriola’s rising effort. The rebound fell to Rodriguez, who settled the ball and calmly slotted it into the right side for his fifth of the year.

“It was a big emotion,” Rodriguez said. “We’ve been struggling, so it was big to get that win for the last couple of games here.”

Notes: United officials will meet with Mesut Özil’s agent Wednesday, though a deal for the Arsenal and German national team midfielder seems far-fetched. …

A person close to the team said United last week had a “conversation” with representatives for former Liverpool forward Daniel Sturridge, but the free agent’s wage demands are out of United’s reach.

Read more on soccer: