Former champion Shawn Porter defeated Danny Garcia by unanimous decision late Saturday to win the vacant World Boxing Council welterweight title.

The 30-year-old won on all three judges scorecards as he threw more punches overall, but Garcia made it razor close by landing a higher percentage of punches at the Barclays Center arena in New York.

It turned out to be a terrific 12-round, 147-pound slugfest as two judges had it 115-113 while the other scored it 116-112.

Porter solidified his position as being one of the best welterweights in boxing’s deepest division.

He is hoping this victory lands him a chance to avenge a loss to unbeaten Keith Thurman, or a unification fight with Errol Spence.

Porter bulled his way through the fight, coming straight ahead and smothering Garcia with jabs and body shots to improve his record in front of the crowd of 13,000.

Garcia made his made his mark in the division with brilliant counterpunching skills, but he also had his left hook working well against the fellow American as the two traded rounds throughout most of the fight.

Garcia suffered just the third loss of his career.

In 2016, he beat Robert Guerrero for the WBC welterweight crown but lost it last year to Thurman in a split decision at Barclays Center. Garcia last fought in February, stopping Brandon Rios.

Thurman needed right elbow surgery after beating Garcia, and suffered a bruised left hand last March in training for his next fight.

He vacated the WBC crown in April, setting the stage for Garcia to face Porter with the winner a possible next foe for Thurman, 28-0 with 22 knockouts.

Garcia disagreed with the outcome.

 “He was throwing a lot,” said Garcia, who falls to 7-2 in world title fights. “I had my defense tight, so I wasn’t feeling his punches. I thought I landed the clearer shots and won this fight.

“I have to sit back, relax and see what’s next for me.”