Irina Pantyusenko staged the protest to coincide with a visit by NATO Secretary General George Robertson to Riga.
Pantyusenko told reporters she supported the radical left-wing organization the National Bolsheviks but that she was acting on her own without the organization's official support.
"This girl is a member of our organization, and she wanted to say that we are against NATO,": said Vladimirs Lindermans, leader of the National Bolsheviks in Latvia. "We are also against Latvia's NATO membership. We believe NATO is an analogy of Hitler's Third Reich.
"She didn't have our direct support, but she does have our moral support."
Pantyusenko chained herself to the university building for 30 minutes before municipal police officers managed to cut her free and arrest her.
While Pantyusenko was staging her protest, Robertson was having lunch with Latvian Foreign Minister Indulis Berzins in the House of the Blackheads, which is located near the university.
She was wearing a T-shirt with anti-NATO slogans and the National Bolsheviks' emblem - the hammer and sickle.
Pantyusenko is from the hometown of Alina Lebedeva, who garnered international attention when she slapped Prince Charles with a red carnation as he greeted people in downtown Riga last November. Lebedeva also said she supported the National Bolsheviks.
Aigars Berzins, spokesman for the municipal police, said Pantyusenko and Lebedeva knew each other and attended the same school in Daugavpils.
Berzins said Pantyusenko was released on Feb. 22 and no charges would be filed.
"I don't know what her plans are now, but I hope she'll go home to her family," he said.