The Olympic swimming sensation Michael Phelps, who was photographed inhaling from a marijuana pipe, has lost a major sponsorship deal and has been suspended from competition for three months.

Kellogg, the food company, said Thursday that it would not renew its contract with Phelps when their deal expires at the end of February. It would not disclose the value of its contract.

Later Thursday, USA Swimming suspended Phelps for three months.

“Michael’s most recent behavior is not consistent with the image of Kellogg,” Susanne Norwitz, a spokeswoman for the company, said in a statement.

Image Michael Phelps at the Meadowbrook Aquatic Center in Baltimore on Friday. Credit... Gail Burton/Associated Press

USA Swimming publicly reprimanded Phelps, who won eight medals at the Beijing Games, temporarily withdrawing its financial support to him and barring him from competition through early May. Phelps receives a monthly stipend of $1,750 from the organization. The national and world championships will be held in the summer.