Midfielder Chris Durkin, left, and D.C. United received an unexpected test from Kei Kamara and lowly Colorado, which has yet to post a victory in seven contests this season. (Kirby Lee-USA Today Sports)

COMMERCE CITY, Colo. -- D.C. United had not looked quite right for a few weeks, and after falling behind the lowly Colorado Rapids on Saturday, one could fairly question whether greater issues were at work.

An eight-minute burst before the first half expired restored order, but in a relapse that threatened to unwind those gains, United hung on for dear life in the second half and escaped with a 3-2 victory.

Wayne Rooney returned to the lineup and Luciano Acosta blazed again. Donovan Pines made a strong impression in his MLS debut and Chris Durkin, 19, scored his first career goal in his first start of the year as United (4-1-2) reclaimed first place in the Eastern Conference.

Acosta leveled the score in the 35th minute. Durkin shattered the deadlock three minutes later and Lucas Rodriguez extended the lead with a terrific run in the 43rd.

Benny Feilhaber scored in the 11th minute and Kei Kamara struck in the 66th for the Rapids (0-5-2), who controlled the early portions of each half and furiously pressed for the equalizer in the last 20-plus minutes before an announced 15,094 at Dick’s Sporting Goods Park.

“The one thing we can do better – and we’ll look to improve – is how we deal with leads,” Coach Ben Olsen said. “You can say that, you can work on it, but if a team says we’re sending eight guys at you, it’s difficult. Sometimes you are going to have to bunker and do some of the dirty work to get results, in particular on the road.”

United was pinned in its own end and labored to connect passes. Almost the entire half was played in D.C.'s end. Defender Steve Birnbaum came to the rescue in the 69th minute with a goal-line clearance.

United had experienced similar problems a few weeks ago against another struggling team (Orlando) when a two-goal halftime lead almost washed completely away during a confounding second half. Like then, United escaped by a whisker.

“It was a strange game,” Rooney said. “First half we were excellent. Second half we didn’t do our jobs properly and we allowed them to put us under a huge amount of pressure. Our defense and goalkeeper were fantastic – dealt with a lot of their threats. We hung on.”

Pines’s MLS debut came with a massive assignment: Kamara, the fifth-leading scorer in league history. He seemed comfortable with the promotion and won some individual duels with Kamara, flashing speed and a 6-foot-5 aerial presence.

“I honestly couldn’t believe I was playing for my hometown team,” said Pines, a homegrown signing from Howard County, Md., who anchored the University of Maryland’s NCAA championship in December. “It was surreal.”

Said Olsen, “It’s a tough game to have your first – it’s against Kei and against that much action in the second half. I thought he held up very well. He didn’t do a lot wrong.”

Added Durkin: “He was a brick wall back there.”

The combination of injuries and a third match in eight days prompted several D.C. lineup changes. Joseph Mora (broken jaw) and his replacement, Chris McCann (hamstring), were unavailable at left back while Leonardo Jara (shoulder) vacated the right corner.

Olsen’s simplest move was reintroducing Rooney after a red-card suspension kept him out of Tuesday’s scoreless draw at home with Montreal and an early-week illness.

In central defense, Olsen rested Frederic Brillant and inserted Pines and Jalen Robinson (15th regular season start in his sixth season) to join Birnbaum for an unusual three-man alignment.

Ulises Segura, a midfielder who started at forward in Rooney’s place Tuesday, continued his formation journey by lining up as the left wing back. Paul Arriola took the same role on the other side.

Durkin replaced Russell Canouse in defensive midfield and partnered with Junior Moreno. Acosta and Rodriguez were in the attacking roles.

The start was troublesome. Colorado went ahead in the 11th minute off a corner kick.

Jack Price served to the edge of the six-yard box, where Tommy Smith beat Birnbaum to the header. Unmarked at the back post, Feilhaber chested the ball down, turned and slammed a close-range shot past Bill Hamid for his second goal of the year.

United, though, began to gain traction. Possession grew and opportunities arose.

It took the visitors until the 35th minute to pierce Colorado’s resistance, and once that occurred, United was on its way.

The uprising began with a set piece, Rooney delivering a corner kick to the back side. Birnbaum’s centering header connected with Pines, who flicked it to Acosta.

Moving across the penalty area, Acosta sidestepped Keegan Rosenberry and Kamara before ripping a rising shot for his first goal since the season opener.

Three minutes later, with the attack humming and confidence brimming, Rodriguez warded off pressure and supplied Durkin on the right side for a pulsating 12-yard finish past Tim Howard and into the far corner.

“I don’t know how I was up there in that position,” Durkin said.

United had not scored in the run of play since the 5-0 rout of Real Salt Lake four matches earlier.

Five minutes passed before United struck again. Rodriguez collected an errant touch by former D.C. defender Kofi Opare and took the initiative, bursting from a nest of three defenders and side-footing the ball past the charging Howard for his second goal of the campaign.

But United surrendered possession to the Rapids in the second half and were under constant duress. Kamara’s easy header was a fitting reward for the dominant Rapids. They certainly deserved another.

Olsen turned to Brillant and Canouse for reinforcement, but Colorado’s pressure continued unabated. The Rapids’ plea for a penalty kick in stoppage time was ignored by referee Ted Unkel.

Unkel’s final whistle brought relief and three points.

“Sometimes you have to play this way on the road,” Birnbaum said. “They had plenty of chances to tie it up or win the game. We got a little lucky in that sense, but it’s still a gutsy performance from the whole team and we were able to grind it out.”

Notes: United will host New York City FC (0-1-5) next Sunday. ... Depleted by D.C. call-ups and visa issues involving international players, second-division Loudoun United (0-2-2) dropped a 2-0 decision at Ottawa (2-1-1). ... Four homegrown players started for United: Pines, Durkin, Robinson and Hamid.

Read more from Post Sports:

Boswell: This Masters brings grand Sunday theater and one big question: Can Tiger get it done?

Brewer: The Capitals are in total control — only in what truly matters

Unlikely hero Brooks Orpik gives Capitals Game 2 win, 2-0 series lead on Hurricanes

Orioles’ Chris Davis breaks MLB-record slump with two-run single against Red Sox