Lochte, the second-to-last performer of the night, had just finished his performance with partner Cheryl Burke when the men, wearing anti-Lochte T-shirts, jumped onto the stage.
Los Angeles police said they arrested Sam Sotoodeh, 59, and Barzeen Soroudi, 25, both of Los Angeles, on trespassing charges. The two men had tickets but were not wearing the T-shirts when they entered the studio, according to police. The show is broadcast live from CBS Television City in Hollywood but airs on ABC.
"We want to publicize that this is a bad decision to have a liar be publicized as a star," one of the suspects was heard saying before being taken away by police.
The men were released Tuesday morning after posting $1,000 in bail. No charges have been filed at this point. The men are tentatively scheduled for a court appearance on Oct. 4.
The incident occurred while judge Carrie Ann Inaba was speaking to Lochte and Burke. Inaba, suddenly distracted, could be heard on the television broadcast saying, "Excuse me. Hey, back off. Excuse me, excuse me, excuse me. Off, off. Excuse me."
Shadows of people racing toward the stage could be seen on television. Host Tom Bergeron was heard off camera saying, "Wow, OK," before sending the show to what appeared to be an unplanned break. Behind Bergeron, both Lochte and Burke appeared flustered by the incident.
Security personnel tackled the two men and took them away from the set, along with four or five women from the audience who appeared to be part of the impromptu protest, according to ABC. Police were called, and the two men were placed under arrest.
When the show returned from break, Bergeron said they had to go to commercial because they had a "little incident," and he thanked the show's security for its fast response.
A 12-time Olympic medalist, Lochte, 32, was banned for 10 months from domestic and international swimming competitions after an incident at a gas station in Rio de Janeiro during the Olympics turned into an international story. Lochte changed his story, from initially saying he was robbed at gunpoint to then recanting and apologizing.
After the show, Lochte said, "We thought it was a joke, something part of the show, but when we realized it wasn't, that hurt, that broke my heart, that people are still on that subject and no one's moving forward."
Burke added, "I was just shocked. I didn't know if they like had anything, had a gun, I don't know what would have happened. ... My heart's racing. I thought I was really nervous for our dance, but this is just a whole other thing right now. This is insane."
Burke said she was "hurt" for Lochte and that she hoped people would give him a chance.
The Lochte scandal from Rio was briefly mentioned both by Bergeron and the swimmer in a recorded segment that aired before the performance. Lochte said during the piece that he was hoping to use "Dancing with the Stars" to show the world he had changed.
After the incident on the broadcast, Lochte told Bergeron he was doing "good," and Bergeron followed up by asking him, "When there is that strong emotion, what does it make you feel like?"
"So many feelings are going through my head right now," Lochte said. "A little hurt but, you know, I came out here and wanted to do something that I'm completely not comfortable with and I did, and I came out here with a big smile and I had the best dance partner."
The judges assured Lochte multiple times that they were there to judge only his ballroom dancing.
Derek Hough, one of the other professional dancers, told People magazine that when the two men moved onto the stage, he also ran to the stage and yelled, "Get them out of here!"
"This is my home, and I was just so shocked that people would come here and be so negative," Hough, 31, told People. "This is a safe place for people to learn a new skill and seek redemption or start a new chapter in their life, and that's what Ryan is trying to do."