Alexandru Mitrita celebrates his first-half hat-trick. (Brad Penner — USA Today Sports)

BRONX — New York City FC played like a championship team Wednesday night.

Quite appropriately, City came close to winning a title — the Eastern Conference crown — by defeating defending MLS Cup champion Atlanta United at Yankee Stadium.

Alexandru Mitrita ignited NYCFC’s attack with a hat-trick in the opening 34 minutes as the hosts recorded a 4-1 triumph in their  final home game of the regular season. Mitrita’s hat-trick was the fifth earliest in league history.

The victory moved NYCFC (17-5-10, 61 points) within a point of a first-round bye and home-field advantage as long as it is alive in the Eastern Conference playoffs. The Philadelphia Union (15-9-7, 52) would have to draw or lose at the San Jose Earthquakes (13-13-5, 42) in a game played later Wednesday night. Atlanta (54) dropped to 17-12-3.

“Today they were outstandingt, an outstanding performance,” NYCFC head coach Dome Torrent said.  “We had to play well because Atlanta is not easy to play.

“It was very important to win the game because because maybe we have to play against this team again in the playoffs. It’s too early to celebrate something.”

City’s ultimate goal is winning another championship — MLS Cup — and the fifth-year team still has a long road ahead before it could accomplish that.

Still, it was a night to remember for Mitrita.

“Everybody tonight talked about Mitrita. Was amazing,” Torrent said.

Mitrita, who raised his goal total of a dozen, started his one-man show in the 14th minute, drilling home an Ismael Tajouri-Shradi feed, from the left side.

The Romanian midfielder doubled the hosts’ lead in the 23rd minute as he latched onto Maxi Moralez’s ball before depositing the ball past goalkeeper Brad Guzan. Moralez became the third player in MLS history to reach 20 assists in a season, joining Carlos Valderrama and Sacha Kljestan.

He finished his superlative first-half showcase by converting a rebound of a Tajouri-Shradi shot from the top of the box that Guzan dived to his left to save in the 34th minute. Mitrita, however, was left open on the right side of the area and all he had to do was tap it home.

Mitrita was replaced by Heber in the 63rd minute as he left the pitch to a standing ovation.

City could have increased its lead to four goals in the 43rd minute after Florentin Pogba took down Moralez in the penalty box. Moralez, however, shot a weak penalty to the left of the net. He is an incredible 4-for-8 taking penalties (.500) this season, a horrible shooting percentage.

Atlanta pulled one back in the 53rd minute after center back Maxime Chanot fouled Brandon Vazquez with an ill-advised sliding tackle. With the Josef Martinez, the regular penalty-kick taker out with an injury, Pity Martinez converted his attempt to the left of goalkeeper Sean Johnson.

Heber, who had missed four games with a quad injury, made an impact in the 87th minute, slotting the ball past Guzan for his team-best 15th goal of the season for the final goal.

Torrent said he might use Heber for 60 minutes in the next game.

“Right now, it’s step by step with Heber,” he said. “It’s important to arrive in the best form for the playoffs.”

The result was a far cry from an earlier loss at Atlanta this season.

“We cannot play the way we played against Atlanta in Atlanta,” Torrent said. “”We played short with much confidence. We played better.”

NYCFC captain Alex Ring endured a tough game. He was assessed his 11th yellow card of the season in the 33rd minute, which meant he won’t play at the New England Revolution Sunday  Early in the second half, he was taken off the field for a couple of minutes after he wound up bleeding after he was hit in the mouth.

Striker Valentin Castellanos was slapped with a yellow card in the 71st minute, and he will miss the New England encounter as well.

Referee Allen Chapman certainly had a busy game as he handed out nine yellows, five on NYCFC.