The Adrian Peterson era in Minnesota officially ended a little after midnight Thursday, when the Vikings and new running back Latavius Murray finally reached a compromise to end a marathon negotiation that had crawled into another day.

Murray flew into town Tuesday and dined with key Vikings decisionmakers that night. He first arrived at Winter Park the following morning. His official free-agent visit stretched into early Wednesday evening. And Murray needed to log onto the internet to participate in an online class for his MBA degree at Syracuse.

So the Vikings set up the 27-year-old with a computer in a conference room and turned their focus to free-agent tight end Jared Cook, who was also visiting Wednesday. After Murray’s 90-minute class concluded and after Cook caught a flight to the Bay Area, the snail-paced negotiation with his agent, Ryan Tollner, continued on.

As contract talks continued late into the night, Murray stayed sharp by devouring a few Mr. Goodbar candy bars. Around midnight, a deal looked imminent.

Sensing that, General Manager Rick Spielman placed a call to Peterson’s agent, Ben Dogra, to inform him they were about to sign another running back. Finally, a little bit before 1 a.m. Thursday, Murray put pen to paper on a three-year deal worth $15 million that includes $8.5 million guaranteed, per a league source.

“It was a late night, but we got things done on both ends,” Murray said Thursday afternoon on a conference call with local reporters. “And that’s all that matters.”

Once the deal was official, Spielman, the sleepy-eyed GM, sent Peterson a text message to let him know that Murray had been signed. Later in the day Thursday, Spielman spoke with Peterson on the phone. So did team ownership, Spielman said.

And just like that, the Adrian Peterson era in Minnesota had come to a quiet close.

“With us signing Murray, Adrian will move on elsewhere,” Spielman later confirmed.

Peterson, whom the Vikings drafted seventh overall in 2007, finished his amazing decadelong run with the Vikings with a franchise-record 11,747 rushing yards and 97 touchdowns on the ground. Peterson was selected to seven Pro Bowls, named a first-team All-Pro five times and was the league’s MVP in 2012, but never led the Vikings to a Super Bowl title.

After Peterson, who turns 32 next week, played in only three games in 2016 because of knee and groin injuries, the Vikings declined to pick up his $18 million option for 2017, making him a free agent last Thursday. A week later, Peterson remains unsigned.

The Vikings, meanwhile, pushed to add a potential replacement, courting former Green Bay Packers running back Eddie Lacy earlier this week before homing in on Murray once Lacy signed a one-year deal with the Seattle Seahawks.

Spielman would not say whether the Vikings ever made Peterson an offer.

“Adrian is probably going to go down as one of the greatest Minnesota Vikings in team history,” Spielman said at the start of Murray’s conference call. “He’ll always be a Viking, I know, to the fans and the people in this building. And he will always have a special place in this franchise and we are very fortunate that we were able to have Adrian Peterson spend most of his career as a Minnesota Viking.”

Murray is fully aware of what Peterson meant to the Vikings and their fan base. He knows he will have big cleats to fill, though Murray will share the backfield with speedy running back Jerick McKinnon and probably, still, a rookie draft pick.

So after getting a few hours of sleep Thursday morning, Murray took to social media to say he would not be wearing No. 28, the number he wore in Oakland.

“There wasn’t a thought in my mind to try and wear or ask for [Peterson’s old number],” Murray wrote on Instagram. “I have too much respect for AP and so much respect for what he’s done and what he means to this organization.”

Murray later said he instead will wear No. 25 as a tribute to his late friend Jonathan Diaz, who was shot to death in Syracuse, N.Y., this past Thanksgiving.

A New York native, Murray rushed for 788 yards and 12 touchdowns for the Raiders last season. In 2015, he rushed for 1,066 yards and made the Pro Bowl. But the Raiders did not prioritize keeping Murray, who turned 27 in January.

Murray, who is 6-3 and 230 pounds, rushed for 2,278 yards and 20 touchdowns in his four years in Oakland, averaging 4.2 yards per carry. The former sixth-round pick from 2013 also recorded 74 receptions combined in 2015 and 2016.

“I know [the Vikings] had a hard time running the ball last year,” he said. “I feel I can come in and run the ball, protect the quarterback and also catch the ball out of the backfield. I’m just a weapon added to an offense that already has weapons.”

The Vikings were unable to add Cook, the former Packers tight end, to that arsenal. He opted to sign with the Raiders less than 24 hours after departing from MSP.

But Spielman on Thursday seemed pleased with what he and the Vikings have been able to accomplish over the past week, signing offensive tackles Riley Reiff and Mike Remmers and defensive lineman Datone Jones, re-signing cornerback Terence Newman and locking in wide receiver Adam Thielen with a long-term extension.

“We feel like we’ve added some very good football players to our roster that are going to fill the needs we felt we had going into this,” Spielman said. “We’ll continue to monitor the free agency and the free agents out there.”

But with Murray under contract, the Vikings will no longer keep tabs on Peterson.