The story was updated to include results from Thursday night's 100-meter butterfly final.
MESA, Ariz. — Michael Phelps is 0-for-1 in his comeback to the pool.
The 22-time Olympic medalist lost to Ryan Lochte in the 100-meter butterfly final at the Arena Grand Prix on Thursday night.
Lochte touched first in 51.93 seconds, second-fastest in the world this year. Phelps was second in 52.13 in his first meet since retiring after the 2012 London Olympics.
Phelps is the three-time Olympic champion and world record-holder in the event. His time tied for fourth-quickest in the world.
Olympian Jason Dunford of Kenya finished third in 53.08.
Phelps was faster in the final than he was in winning his preliminary heat with a time of 52.84.
Swimming before a sellout crowd and lots of cameras, Lochte led at the turn and Phelps was second.
"Down there at the turn, I kind of peeked over, and I saw him and almost started smiling," Lochte said about his longtime friend and rival.
Phelps interjected, "Why? Because you were ahead?"
An on-deck interviewer reminded Phelps his mother has said she wants to go to Rio for the 2016 Olympics, which would be his fifth.
"Whatever he wants," Debbie Phelps shouted from the stands.
Phelps replied, "Good mother."
Phelps wasn't smiling as he walked on deck for the final, unlike in the prelims. He kept his ear buds in until he was introduced as an 18-time Olympic gold medalist. With his long hair sticking out from the back of his cap, he dived in next to Lochte, who beat him down to the first turn.
Earlier Thursday, retired speedskater Apolo Anton Ohno, the most decorated U.S. Winter Olympian, tweeted good luck to Phelps, saying, "Excited to see you back brother."
The three-day meet sold out every session the day his comeback was announced last week, with a capacity of 1,200 at Skyline Aquatic Center. A pair of $40 all-session tickets was being advertised online for $250. USA Swimming issued 100 media credentials — five times more than usual.
The possible future of American swimming with the same first name as Phelps was in the 100 fly heats. Michael Andrew, a 15-year-old from Lawrence, Kan., qualified for the 'C' final in 55.23. He has broken more than 30 national age-group records and last June became the youngest U.S. male swimmer to turn pro. He was excited to meet his idol Phelps on Wednesday.
"Swimming needs you!" he tweeted after they traded handshakes. "You rock!"
A giddy Phelps qualified fastest for the 100-meter butterfly final Thursday in his morning qualifying heat.
The 28-year-old swimmer was second at the turn and came on down the stretch to win his heat in 52.84 seconds at the Arena Grand Prix, easily advancing to the evening final.
"I felt like a summer league swimmer today," Phelps said, smiling. "I felt like I should have my heat and lane written on my hand so I didn't forget it."
Lochte was second-quickest, winning his heat in 52.94. Joining them in the eight-man final were Dunford and two-time Olympian Albert Subirats of Venezuela.
Phelps and Lochte joked with each other behind the starting blocks when Phelps came out early for his heat, which came after Lochte's.
"He said, 'Maybe we should both just mess around and see if we can both get in the 'C' final,'" Phelps said.
Phelps' longtime coach Bob Bowman liked what he saw.
"I could tell when he came in that it was going to be good, that he was into it," he said.
Phelps walked on deck wearing his usual ear buds, but his smile replaced the serious look he always wore during the height of his career.
"It was more like I was just so excited to swim," he said. "You're going to hear this word come out of my mouth a lot — it was fun."
The 22-time Olympic medalist was greeted with loud cheers from the packed stands.
"It really is wild. It's good for the sport," Phelps said about his reception. "This is the sport I've known my whole entire life and loved my whole life. When I heard the roar in the stands, it's amazing."
Phelps' time was easily good enough to surpass the qualifying standard of 54.79 for the U.S. national championships in August. That meet will decide the team for next year's world championships.
"One step at a time," he said.