The companies made their announcements after Lochte lied about being robbed at gunpoint by a policeman after a night out during the Rio Olympics.
Speedo said: “We cannot condone behaviour that is counter to the values this brand has long stood for.”
Lochte said he respected Speedo’s decision and thanked the company.
“I am grateful for the opportunities that our partnership has afforded me over the years,” he said.
A third sponsor, a hair removal company called Syneron Candela, has also cancelled its sponsorship of the swimmer.
Ralph Lauren, which has removed some of Lochte’s images from its website, said its sponsorship had been only for the Rio Olympics and would not be renewed.
Speedo said it would donate a $50,000 portion of Lochte’s sponsorship fee to the charity Save The Children’s Brazilian operation.
The value of Lochte’s Speedo sponsorship has not been disclosed. The contract reportedly expires this year after 10 years.
The US business magazine Forbes calculated that in the year of the 2012 London Olympics, Lochte earned about $2m in sponsorships from companies such as Gillette, Nissan, AT&T and Gatorade.
Lochte’s performance at Rio did not reach the heights of his London triumph, but Forbes estimated his endorsements would still have been between $1m-$2m.
The saga started when Lochte and three team-mates returned to the Olympic village after a late night out in Rio.
They tried, unsuccessfully, to use the locked toilet at a garage and urinated outside instead.
After first claiming that he and his three team-mates had been robbed by bogus policemen, Lochte back-tracked and admitted he had, while still drunk, “left details out” and “over-exaggerated some parts of the story”.
Despite the evidence against him, including CCTV footage, he has however denied that he actually lied in his initial account to Brazilian police.
Lochte’s behaviour has been met with disdain in the US and he has been widely pilloried in the US media.
On 19 August the New York Post carried a front-page headline describing him as the “Ugly American”, along with the slogan “Liar, Liar, Speedo on fire”.
Lochte is one of the most successful swimmers in history, with 12 Olympic medals, and he once had his own reality television show in the US.
In Rio, he swam in two events, winning a gold medal in the 4x200m freestyle relay along with team-mate Jack Conger.
“We appreciate his many achievements and hope he moves forward and learns from this experience,” Speedo said of Lochte.
The swimmer’s other sponsors include mattress maker Airweave.