NEW YORK -- Gennady Golovkin lost his knockout streak, but he retained his middleweight championship belts.

Daniel Jacobs gave Golovkin the toughest fight of his 11-year career by pushing him to the 12-round distance for the first time, but Golovkin prevailed by unanimous decision on Saturday night before an electric crowd of 19,939 at Madison Square Garden.

Judges Don Trella and Steve Weisfeld both scored the fight 115-112, and Max DeLuca had it 114-113 for Golovkin, who scored a knockdown in the fourth round. ESPN.com also had Golovkin winning 115-112.

Golovkin's 23-fight knockout streak, dating to an eight-round decision win in November 2008, came to an end.

As Golovkin (37-0, 33 KOs) retained his title for the 18th consecutive time -- just two away from tying Bernard Hopkins' division record of 20 -- he turned back a stiff challenge from Jacobs in one of the year's most significant fights, which matched the 160-pound division's top two fighters.

With the fight as close as it was, they'll probably stay that way.

"I respect Daniel Jacobs, and he did a very good job and clean job," Golovkin said. "Daniel Jacobs is my favorite fighter -- quality, very good fighter after I knocked him down. I respect his team."

Mandatory challenger Jacobs (32-2, 29 KOs), who lost his secondary title, came in as a prohibitive underdog but didn't fight like it, though he suffered the third knockdown of his career.

Gennady Golovkin, right, retained his middleweight title for the 18th straight time but had to go the full 12 rounds against Daniel Jacobs on Saturday night. AP Photo/Frank Franklin II

Jacobs said he believed he won the fight.

"I think I won the fight, and I think the fans support me," Jacobs said. "I think I won by two rounds at least. They want the big fight [for Golovkin against Canelo Alvarez], and Daniel Jacobs got X'd out. I won the fight, and I won the decision, and all I can do is be gracious in the decision."

Although Golovkin won, he was not nearly as explosive as fans have come to expect, but trainer Abel Sanchez said he was still happy with how Golovkin performed.

"We got the rounds in. We got the tough rounds that we needed," Sanchez said. "I give G a 7½ or 8 out of 10. Daniel was very strong and had athleticism, and Gennady's accuracy was not quite as pinpoint as in the past, but I'm happy with Gennady's performance, and I'm happy the fans got to see a great fight."

Before Saturday, the deepest Golovkin had gone into a fight was the 11th round against Martin Murray in a 2015 title defense. Now his KO streak is history.

Punch stats Punches Golovkin Jacobs Landed 231 175 Thrown 615 541 Percent 38% 32% -- Courtesy of CompuBox

"Twenty-three knockouts in a row is a pretty great run," Golovkin promoter Tom Loeffler of K2 Promotions said. "Can't knock everyone out, and because of Danny's class and his size and his boxing IQ, he put up a great fight. We knew going in it would be a tough fight. You can never overlook Danny Jacobs, but Gennady welcomed the challenge to show where his skills were at. Maybe because he didn't knock out Danny, it will give some other top middleweights motivation to get in the ring with him.

"We haven't seen a decision with Gennady for a long time, and it's not something we're used to, but it shows what a great warrior Daniel Jacobs is. There was no dancing here. It was all warriors with a lot of heart."

Golovkin did not lament the end of the KO streak.

"I need the decision," he said. "I wasn't thinking that I needed the 12th round to win the fight. This was my first test at 12 rounds. I needed a quality fight -- not just the 12 rounds."

The fight opened with both fighters very cautious and perhaps wary of each other's power. Jacobs flicked out a few jabs, but the first round was largely a staring contest.

Jacobs, 29, of Brooklyn, tried to mix things up in the second round when he switched to a southpaw stance, but he quickly abandoned the tactic.

Golovkin finally found his mark in the fourth round when he nailed Jacobs with a pair of right hands, sending Jacobs to the canvas early in the round. Golovkin tried to follow up, but Jacobs' defense was solid. It was the third time Jacobs had been down in his career.

"Gennady dropped him, but you could tell Danny wasn't hurt from the punch," Loeffler said.

Golovkin landed a solid right hand to the side of Jacobs' head early in the fifth round and mixed in some powerful body shots. He seemed to be in control against Jacobs, who looked very wary of Golovkin's power.

"After the knockdown, I told him he'd have to kill me," Jacobs said. "When I got up, I thought, 'This is all he has?' There were many times during the fight I went toe-to-toe because I knew I could. I got back up, and I thought I won the fight."

The seventh round heated up late and spilled over after the bell, as they continued to fire punches until referee Charlie Fitch broke them apart. As Jacobs walked back to his corner, he pumped his arms toward a section of his fans at ringside.

Golovkin, 34, had a big ninth round, nailing Jacobs with a pair of solid right uppercuts and then wobbling him with a right hand. But the round ran out before Golovkin could land another big shot.

After Jacobs, whose left eye was swelling, landed a solid right hand that seemed to briefly stun Golovkin as the 10th round ended, the crowd tried to lift Golovkin in the 11th with chants of "Triple G! Triple G!" echoing through the arena.

The fight appeared very close going to the 12th round, and it marked the first time Golovkin had gone that far in his career.

Golovkin, who earned at least $2.5 million, landed 231 of 615 punches (38 percent), and Jacobs, who made at least $1.75 million, landed 175 of 541 (32 percent), according to CompuBox

Golovkin could return June 11 in his native Kazakhstan to fight Billy Joe Saunders for the one major belt he doesn't already own. There is also still the possibility of a long-awaited showdown with Mexican star Alvarez, but Alvarez first faces Julio Cesar Chavez Jr. on May 6.

"We have to see what happens with Canelo in May, but that would be the priority," Loeffler said. "Danny fought a terrific fight. They both did."

As always, Golovkin said he's ready for Alvarez.

"Of course I want that fight," he said. "I am like an animal for that fight, but I will give Danny Jacobs a chance for a rematch."