United forward Wayne Rooney is congratulated by teammates after scoring on a swerving free kick from about 35 yards out. (John McDonnell/The Washington Post)

The ball took flight some 35 yards from the north goal at Audi Field, an impossible distance for most soccer players, certainly out of the range of someone whom skeptics did not think had much left when he joined D.C. United three months ago.

The ball rose over Toronto FC’s wall and, for a moment, looked as if it would sail a few yards wide of the right post. Then it began to bend, pick up speed and accuracy, and despite the goalkeeper’s finest efforts, Wayne Rooney’s free kick splashed into the upper right corner of the net.

The Englishman has provided more than a few memorable moments since his multimillion dollar signing this summer, and on Wednesday, he did it again with a sensational early goal in a 1-0 victory that moved United to the verge of an unfathomable playoff berth.

Rooney’s sixth goal in five matches -- giving him 10 since mid-July -- extended United’s winning streak to four and unbeaten run to eight. The surging club grew its lead over Montreal to four points for the sixth and final playoff berth in MLS’s Eastern Conference.

With two matches left, one D.C. victory or one Montreal defeat will secure passage for a team that sat in last place for most of the summer. United also pulled within one point of fifth-place Columbus and three of Philadelphia.

D.C. (13-11-8) was not at its best over 90 minutes, but no one will remember anything other than Rooney’s spectacular free kick before 18,562 at Buzzard Point.

Given the distance, Rooney had to decide whether to take the low-percentage shot or serve the ball into the penalty area.

“I just thought to give it a go and see what happens,” he said. “Thankfully I caught it perfect. In the end, I made the right decision.”

Waiting in the penalty area, teammate Steve Birnbaum awaited a possible high ball for him to head.

“It was so far away, I was like, ‘He is definitely serving it in,’" the central defender said. “And then I saw him run up and smash it. It was pretty unbelievable. It was so far out, I couldn’t believe he got so much power behind it.”

Coach Ben Olsen said of Rooney’s options: "It’s completely up to Wayne in that moment. I didn’t give him any hand signals. That is his call. He has earned that right because I’ve seen that consistently.

“I have to look at it again, how spectacular it was. In real time, it was pretty impressive.”

Toronto (9-17-6) arrived as a shell of its 2017 championship self, out of playoff contention, missing several key players and going through the motions after becoming just the fourth MLS Cup champion to miss the postseason the following year.

Sebastian Giovinco, an Italian star, skipped the visit after serving national team duty the past 10 days. Jozy Altidore, the U.S. national team striker, sat out with lingering injuries. Spanish midfielder Victor Vazquez had surgery last week and Canadian midfielder Jonathan Osorio wasn’t available after playing for his national team Tuesday.

The contrasts between lineup strength and incentive did not offer much comfort to Olsen, who, since the dramatic victory over Dallas on Saturday, had warned against overconfidence and complacency.

Toronto threatened to go ahead in the 11th minute, but Bill Hamid made a remarkable reflex save on Nick Hagglund’s close-in header.

Seven minutes later, Toronto committed a foul at a spot that appeared out of Rooney’s range. Would he chip the ball deep into the box? Or maybe try to catch Toronto by surprise by swinging a pass wide on the ground?

Don’t be silly.

“I was definitely expecting him to hit it, but that finish was world class,” D.C. defender Nick DeLeon said. “I was smiling from ear to ear. It was a big-time goal from a world-class player.”

United received a major scare in the 33rd minute when Hamid’s left knee buckled as he corralled a high ball and landed. He has a history of knee problems, and judging by his immediate reaction, it appeared serious.

Hamid remained in the match but was clearly uncomfortable, limping around the penalty area when the ball was downfield and reaching for the knee regularly.

United almost scored again just before intermission, but DeLeon’s header off Rooney’s corner kick caromed off teammate Yamil Asad and kissed the crossbar.

Hamid returned for the start of the second half and showed a slight limp but not any noticeable difficulty sliding or jumping. Just in case, back-up Travis Worra continued loosening up in the corner.

Afterward, Olsen said he thought the knee was hyperextended. The medical staff called it a strain.

Acosta should’ve grown the lead in the 57th minute, but after waltzing through the heart of the box, he hit the left post.

United survived a few nervy moments in the second half but did well managing the ball -- and the clock -- while failing to score a clinching goal.

Now, a once-wayward club is almost certain of qualifying for the playoffs.

“It’s been a lot of fun the last two months,” Olsen said. “The job is not done. We would like to continue this form and finish this home stretch with a win and seal our playoffs.”

United notes: DeLeon made his first start since injuring a knee in May. ... A day after playing 22 minutes for the Costa Rican national team against Colombia in Harrison, N.J., midfielder Ulises Segura logged the last 16 for D.C. ... Forward Darren Mattocks returned from Jamaican duty but was not in uniform because of illness. ... Defender Kofi Opare has recovered from a hip injury and is now battling an ankle ailment.