NYCFC celebrates David Villa’s goal.  (Dennis Schneidler-USA TODAY Sports)

BRONX, N.Y. — New York City FC secured a home knockout-round match by defeating the Philadelphia Union in its regular-season finale Sunday.

City recorded a 3-1 Major League Soccer win over Philly at Yankee Stadium.

NYCFC (16-10-8, 56 points) will play in a knockout-round match in the MLS Cup Playoffs Wednesday at 7 p.m.

If the side wins, it would host an Eastern Conference semifinal match against an opponent to be determined. It would be either the Union (15-14-5, 5) or the Columbus Crew, whose Decision Day match was delayed by inclement weather and was still going on after the NYCFC encounter was called.

The hosts scored all their goals within the opening 34 minutes.

Center back Maxime Chanot, off a Maxi Moralez feed lifted NYCFC into the lead in the eighth minute. Two minutes later, an Auston Trusty own goal gave City a 2-0 advantage.

After Cory Burke pulled one back in the 14th minute, team captain David Villa tallied his team-high 14th goal of the season to give City some breathing room.