Perry Kitchen points to the air after scoring a goal in the 13th minute. (Don Ryan/Associated Press)

Undermanned and nearly unhinged by a nutty sequence, D.C. United endured 45 minutes of second-half madness Sunday at raucous Jeld-Wen Field to secure one of the most rewarding and harrowing victories in recent memory.

The 3-2 triumph over the Timbers — on goals by Perry Kitchen, Chris Pontius and Josh Wolff — extended United’s unbeaten run to four and halted Portland’s home winning streak to start their MLS maiden season at five. Pontius’s penalty kick broke a 1-1 tie in the 75th minute to help United (4-4-3) move into third place in the Eastern Conference.

But those facts were hardly the most remarkable aspects of a wild affair before a sellout crowd of 18,627.

With his team leading 1-0 in the 65th minute, United goalkeeper Bill Hamid went to his right to block Kenny Cooper’s penalty kick. Assistant referee Eric Proctor ruled, however, that Hamid had left the goal line before the attempt, sparking furious protest.

TV replays supported Proctor’s decision, but it’s one of those infractions in sports, like a phantom tag in baseball, that is rarely enforced. So Cooper tried again . . . and Hamid denied him again . . . and Proctor lifted his flag again, signaling another premature step by the 20-year-old keeper. Replays showed Hamid moving, but not as soon as on the first try.

There was no such controversy on Portland’s third effort, by Jack Jewsbury, to tie the score.

“It happens everywhere around the world and this guy calls it twice,” Hamid said. “The second one, I definitely kept it in mind: ‘Alright, stay back and make the save — react.’ For him to call it a second time, I don’t know what’s going on.”

At that point, given the circumstances, the momentum shift, the noise, a shaken D.C. squad was vulnerable to collapse. Instead, United responded with the go-ahead goal, extended the lead on Wolff’s finish, then survived Jorge Perlaza’s late strike and heavy pressure by the Timbers (5-4-2).

“After that call [on the penalty kick], and the second call, to regroup after that in front of this crowd, shows a lot of character,” United Coach Ben Olsen said. “I couldn’t have regrouped. I would’ve followed the referee for 40 minutes and been in his ear and would’ve been useless.”

United was furious about referee Geoff Gamble’s decision to award the penalty kick. Defender Dejan Jakovic was called for pulling down Cooper.

“It was bad,” Jakovic said. “I told him to take a look at it. He said he will.”

“Mentally, it’s tough,” he said about Portland’s three-bid penalty kick. “We told ourselves to relax, that there were a lot of minutes to play, and we did an unbelievable job of overcoming that and continuing to play our game. We knew we were going to get another chance.”

It came under questionable circumstances, when Diego Chara’s arm swept into the ball after he slid to disrupt Pontius’s run into the box. Olsen called it a “phantom call for us.”

Pontius deposited the penalty kick for his fourth goal. “People probably thought we were going to lose it mentally, but we stayed tuned in,” he said.

With the Timber Army fans and mascot Timber Joey’s chainsaw serving as the soundtrack, United withstood steady pressure in both halves.

The loss of captain Dax McCarty, who injured his groin at midweek training, added to a group of unavailable players that almost formed an entire lineup: goalkeeper Steve Cronin (wife to give birth); defenders Jed Zayner (hamstring), Marc Burch (hamstring) and Devon McTavish (concussion); midfielders McCarty, Branko Boskovic (knee), Kurt Morsink (ankle), Santino Quaranta (concussion) and Junior Carreiro (ankle); and forward Charlie Davies (hamstring).

Wolff, recovering from a groin ailment, was fit enough for inclusion on the game-day roster but began in reserve. Davies (team-high six goals) is expected to return Friday at Los Angeles.

As a result of the front-line absences, rookie Blake Brettschneider and Joseph Ngwenya maintained a partnership forged in the second half against Dutch champion Ajax last weekend.

Despite the personnel issues, United went ahead in the 13th minute. Susceptible to dead ball situations all spring, United scored on one. Pontius launched a throw-in toward the end line, where Brettschneider contorted his airborne frame to head the ball back into the path of the on-rushing Kitchen for a five-yard stab.

The madness began in the second half and didn’t let up until Gamble’s final whistle.

Said Olsen, “It’s a big step for us.”