Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The campaigns of Ted Cruz and John Kasich announced an agreement Sunday night to coordinate their efforts to prevent Donald Trump from winning the GOP's presidential nomination before the Republican National Convention.

"To ensure that we nominate a Republican who can unify the Republican Party and win in November, our campaign will focus its time and resources in Indiana and in turn clear the path for Gov. Kasich to compete in Oregon and New Mexico," Cruz's campaign manager Jeff Roe said in a statement late Sunday.

The Kasich campaign sent its own statement minutes later.

"Our goal is to have an open convention in Cleveland, where we are confident a candidate capable of uniting the party and winning in November will emerge as the nominee," Kasich's chief strategist, John Weaver, wrote.

Trump responded late Sunday, tweeting that "Lyin' Ted" and Kasich were colluding against him.

Wow, just announced that Lyin' Ted and Kasich are going to collude in order to keep me from getting the Republican nomination. DESPERATION! — Donald J. Trump (@realDonaldTrump) April 25, 2016

Trump later released a statement calling it "sad" that "these two Washington insiders have had to revert to collusion in order to stay alive."

He also reiterated his often-repeated claim that the GOP primary is "rigged."

"When two candidates who have no path to victory get together to stop a candidate who is expanding the party by millions of voters, (all of whom will drop out if I am not in the race) it is yet another example of everything that is wrong in Washington and our political system," Trump said in the statement.

Cruz's and Ohio governor's partnership is a recognition that Trump has a legitimate chance to earn 1,237 delegates through the primary process and clinch the nomination. The alliance came after Cruz was all but mathematically eliminated from winning the nomination outright.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

For weeks, Cruz has framed the campaign as a "two-man race." Now, with Kasich conceding Indiana, Cruz will need to prove that he can beat Trump in what will effectively be a head-to-head matchup. The Indiana primary is May 3.

Preventing Trump from winning outright would force the front-runner to persuade additional delegates to his side on the convention floor to reach the magic number of 1,237. And a convention battle would give Cruz and Kasich the opportunity to wrangle delegates away as they become unbound in subsequent ballots.

Ohio Gov. John Kasich speaks at a campaign event last week in Glastonbury, Connecticut. Jessica Hill / AP

The Cruz and Kasich camps had been openly feuding in recent days, with each candidate slamming the other in public and their teams sparring with reporters privately.

The Texas senator called Kasich a "spoiler" at a press availability at the RNC Spring Meeting in Florida — and Kasich in turn insisted he wasn't running to be vice president.

Their aides, meanwhile, were openly feuding in the hallways of the sprawling resort.

But the mood changed after top Trump aides Paul Manafort and Rick Wiley arrived to try to convince party operatives that Trump could win ahead of the Cleveland convention — and it became clear that the Cruz-Kasich feud was convincing top Republicans that it might be better to simply coalesce behind Trump.

Kasich was scheduled to campaign in Indiana on Tuesday, with a town hall at the Hamilton County Fairgrounds in Noblesville and an election night party in Indianapolis. Both of those events were called off, the campaign said, although Kasich is still scheduled to hold a fund-raiser in the state Tuesday.

A senior Kasich aide told NBC News that the pact comes as "everybody needed an open convention, and that's how you get there." The goal is to make it clear that they hope outside groups like the Stop Trump forces will help out both sides.

"We are very comfortable with our delegate position in Indiana already," Weaver said in the memo, referring to the Kasich campaign's claim to have already gained more committed delegates in the state than either Trump or Cruz.

The latest Fox News poll of Indiana showed Kasich trailing Trump and Cruz there, with Trump at 41 percent, Cruz at 33 percent and Kasich at 16 percent. The Club For Growth already went up in Indiana with a $1.5 million buy with an ad that said Kasich's math doesn't work and that he "helps Trump by dividing the opposition."

Included in the statements from Cruz and Kasich are clear signals not just to their super PACs but also to members of the Stop Trump movement. For days, Kasich's campaign has been growing increasingly frustrated at what top aides perceived as a lack of backup from the Stop Trump movement.

A Kasich campaign aide told NBC News: "It's time for them to put their money where their mouth is."

Members of the "Stop Trump" movement were already signaling that they were relieved by the news.

A Republican operative affiliated with the movement told NBC News that the campaigns "finally grasped the value of the strategy we've deployed all along."

And the head of the anti-Trump "Our Principles" PAC, Katie Packer, said she's "encouraged" by the news, tweeting: "Will keep focusing energy on @realDonaldTrump."

Encouraged by @tedcruz & @JohnKasich plans to clear way for the other in states out of reach.Will keep focusing energy on @realDonaldTrump — Katie Packer (@katiepack) April 25, 2016

While Indiana has already been a vocal focus of the "Stop Trump" movement, the state has 57 delegates at stake, while Oregon (28) and New Mexico (24) have almost that together.

Weaver said in his memo that New Mexico and Oregon are "structurally similar to the Northeast politically, where Gov. Kasich is performing well," and the Kasich campaign believes it could be strong in New Mexico because it's more of a purple state.

Cruz's concession of New Mexico, which allocates delegates proportionally, is an about-face for the campaign. Just last month, a top aide predicted that Cruz would earn a majority of delegates in that state.

Ted Cruz waves to supporters Sunday at Woodrow Wilson Middle School in Terre Haute, Indiana. Aaron P. Bernstein / Reuters

The news, meanwhile, comes as Kasich's campaign is working hard to conserve resources and finances. His most recent campaign finance report (PDF) showed that he ended March with just $1.16 million cash on hand, far less than any of the other major candidates still in the race.

While Cruz focuses on Indiana this week, with multiple stops scheduled across the state Monday, Kasich will make the turn to Oregon, with events in Portland and Medford on Thursday.

The agreement is not to be viewed as a formal alliance, but it's a start, and a Kasich aide left open the possibility that there could be more conversations about divvying up the map in the future.