Sources: Jorge Linares-Vasyl Lomachenko fight finalized for May 12 at Madison Square Garden

Though the fight was touch-and-go in recent weeks, the highly anticipated bout between lightweight world champion Jorge Linares and junior lightweight champion Vasyl Lomachenko is a done deal.

Linares will defend his 135-pound crown against Lomachenko, who will move up from 130 pounds, on May 12 at Madison Square Garden in New York in the main event of a Top Rank ESPN card, multiple sources with knowledge of the contract signing told ESPN.

Terms of the deal had been agreed to a few weeks ago, but the fight was in jeopardy because of a disagreement over the date between Linares co-promoter Golden Boy Promotions and Top Rank, which promotes Lomachenko, the pound-for-pound king.

Top Rank had secured May 12 for Lomachenko's next fight at Madison Square Garden, but Golden Boy is promoting its own event headlined by the mandatory fight between junior middleweight titlist Sadam Ali and Liam Smith on the same night on HBO. Golden Boy did not want to compete against its own show, and it was a deal-breaker for Linares-Lomachenko.

The solution was to see whether Top Rank and ESPN were willing to start the card earlier in the evening so it would be over before the HBO telecast. Ultimately, ESPN was able to tweak the schedule so the shows won't conflict with each other. Once that was worked out, Top Rank and Golden Boy signed their contract with each other on Monday afternoon, sources said.

Representatives for Top Rank and Golden Boy declined to comment because they wanted to wait for the formal announcement of the fight.

The fight is not only one of the most significant that can be made in boxing, but it also shows that longtime bitter rivals Top Rank and Golden Boy can make fights together, although most of the deal was ironed out between Top Rank and Japan's Teiken Promotions, Linares' co-promoter.

Venezuela's Linares (44-3, 27 KOs), 32, who fights out of Las Vegas, has won world titles in three weight classes (featherweight, junior lightweight and lightweight) and will be making the fourth defense of his second lightweight title reign. He is coming off a decision victory against Mercito Gesta on Jan. 27 at The Forum in Inglewood, California. Since suffering back-to-back losses in 2011 and 2012, Linares has won 13 fights in a row.

Lomachenko (10-1, 8 KOs), a 30-year-old southpaw who won back-to-back Olympic gold medals for Ukraine in 2008 and 2012, will be seeking a world title in his third division, having already won titles at featherweight and junior lightweight in record-setting fashion.

In his last fight, on Dec. 9 at the Theater at Madison Square Garden in New York, Lomachenko dominated Guillermo Rigondeaux in the first fight between two-time Olympic gold medalists and was later voted the 2017 fighter of the year by the Boxing Writers Association of America.

Lomachenko made Rigondeaux quit after the sixth round. He was the fourth opponent in a row to quit against Lomachenko.

Lomachenko won a featherweight world title in his third pro fight, tying the record for fewest fights needed to win a world title. When he won a junior lightweight title in his seventh fight in 2016, he set the record for fewest fights to win a world title in two weight classes. If he defeats Linares in his 12th fight, Lomachenko will set the record for fewest fights needed to win a world title in three divisions.