Ricardo Bocanegra had a six-minute brace in the opening half. (Photo courtesy of the Cosmos)

MEDFORD, Mass. — Midfielder Ricardo Bocanegra scored twice within a six-minute span in the first half to boost the Cosmos to a 3-1 victory over Boston City FC in a National Premier Soccer League match at Hormel Stadium Saturday night.

The win kept the undefeated Cosmos (9-0-0, 27 points), who won the season series, atop the North Atlantic Conference and another step toward clinching a playoff spot. Boston City FC (5) dropped to 1-8-2.

Bocanegra gave the Cosmos a 1-0 lead in the 13th minute as he took advantage of a throw-in and beat goalkeeper Jason Katz.

Four minutes later, Boston City FC equalized at 1-1. Francisco Silva’s long ball down the left flank found Hugo Bomfim, who beat goalkeeper Jesse Corke as he scored his second goal of the season.

Bocanegra snapped the tie in the 19th minute. Darwin Espinal send in a cross to Bocanegra, who fired a shot that Katz saved. Bocanegra then cleaned up the rebound for a 2-1 margin.

Espinal tallied an insurance goal in the 65th minute as he motored down the left wing and drilled a shot from the crossbar from a close angle for a 3-1 lead. It was Espinal’s fourth goal in three matches against Boston City FC.

The Cosmos won’t have much time to rest as they will meet Rhode Island Reds FC (3-4-1, 10) at Johnston High School in Johnston, R.I. on Sunday at 5 p.m.

After Sunday’s game, the Cosmos return home to close out the regular season with four successive games at Mitchel Athletic Complex in Uniondale, N.Y.

They welcome the Greater Lowell Rough Diamonds on June 23 at 8 p.m., Rhode Island on June 30 at 5 p.m., Brooklyn Italians on July 3 at 8 p.m. and Kingston Stockade FC on July 6 at 7 p.m.