Mr Trump, unpopular with many in his own party, now has a clear path to the 1,237 delegates needed to claim his party’s crown.
That would mark a stunning victory for a businessman few took seriously when he launched his campaign last year.
Bernie Sanders has defeated Hillary Clinton in Indiana’s Democratic race.
He trails Mrs Clinton in the all-important delegate count but after this victory he said the contest was still alive.
“Clinton campaign thinks this campaign is over. They’re wrong,” he said.
Mr Cruz’s advisers had targeted Indiana as the Texas senator’s best hope of halting Mr Trump’s march to the nomination.
“We gave it everything we’ve got, but the voters chose another path,” he told supporters in Indiana.
His departure means Mr Trump is now the presumptive Republican nominee, with plenty of state contests this month and next to reach the 1,237 delegates required to win.
The New York businessman is the first nominee since Dwight Eisenhower in 1952 to lack any previous experience of elected office.
Ohio Governor John Kasich has vowed to remain in the Republican race, but trails far behind Mr Trump in terms of delegates.
The Cruz party is over – Anthony Zurcher, BBC News, Indianapolis
Turn out the lights, the party’s over. Ted Cruz and the #NeverTrump movement threw everything they had at Donald Trump in Indiana, and it wasn’t enough. It wasn’t even close to enough.
They outspent him by more than a million dollars. Mr Cruz practically took up residence in the state for the past two weeks. He named Carly Fiorina as his running mate. Nothing worked.
If there was a defining moment of the Indiana campaign, it was Mr Cruz’s fruitless attempt to reason with a group of pro-Trump supporters on Sunday.
Every argument he advanced was rebuffed. Every bit of evidence of Trump malfeasance was denied. Mr Cruz was shouting in the wind.
In the coming days there will be a great reckoning, as the party comes to terms with the prospect of Mr Trump as their standard bearer in the autumn. Some will make peace. Some will despair. Others will say “I’m with her” and reluctantly move to Hillary Clinton’s side.
It will be an unprecedented spectacle in modern US political history.
“It is a beautiful thing to watch, and a beautiful thing to behold,” Trump said during a victory speech. “We are going to make America great again.”
He praised Mr Cruz as a “tough, smart competitor”, which marked a sharp reversal in tone after a day when the two men slung mud at each other from close quarters.
US media reaction
- Donald Trump has humiliated those who had faith that the Republican leadership could stop him and proved that the party is full of bunglers akin to the cartoon character Homer Simpson, writes Stephen Stromberg in the Washington Post
- Ted Cruz did not offer any congratulations or support to Mr Trump, and did not even mention his name, Politico says, although he offered what it described as a veiled jab, saying that America was kind, “not boastful or mean-spirited”
- Mr Trump is well behind Hillary Clinton in national polls and is struggling to reunite voters who supported Republican presidential candidate Mitt Romney in the 2012 election, says the New York Times
- The Huffington Post says that Bernie Sanders will benefit from Mr Cruz’s departure, as Mr Trump concentrates his fire on Mrs Clinton, who is forced to fight on two fronts, and news coverage focuses more on the Democratic race
The verbal attacks reached a new level of intensity when Mr Cruz attacked the billionaire businessman as a “pathological liar” and “serial philanderer”.
That was provoked by a bizarre claim from Mr Trump that Mr Cruz’s father was linked to one of the most traumatic episodes in US history, the assassination of President John F Kennedy.
It is now increasingly likely that Mr Trump will face Mrs Clinton in the autumn in the battle to succeed President Barack Obama, who will be leaving the White House after two terms.
But Republicans have expressed reservations about Mr Trump’s outspoken remarks, which have offended women and Hispanics.
There are also concerns about some of his policies on immigration and national security, like building a wall on the southern US border paid for by Mexico, a ban on Muslims coming to the US and the killing of the families of terrorists.