"My client has been released and he is no longer a suspect in this investigation," Karl Harling told Swedish news agency TT.
The man was taken into custody at a Migration Agency apartment that he shared with his mother in Örkelljunga in southern Sweden.
"I knew from the start that they had the wrong man," his mother told TT on Tuesday evening. "I have said the whole time that it was impossible that he did this. I'm going to die of happiness when I see him. I want to hug him a lot."
The man had been held at Stockholm's Kronoberg detention facility, where the lead suspect Rakhmat Akilov is also being held. Akilov has admitted to driving a truck down Stockholm's busiest shopping street, Drottninggatan, killing four people.
Over the weekend, Akilov's 44-year-old brother Olim Akilov was detained by the Uzbek authorities. According to the relatives, the authorities have given no explanation for his arrest.
The arrest came after Sweden's Aftonbladet newspaper interviewed Olim Akilov. In the interview, published on Wednesday, Akilov claimed that his brother had never shown any interest in religion, and was an intelligent, open, and modern person who was happy living in Sweden.
"He loved Sweden and said that it was a perfect country. He wanted to start a new life there," Olim Akilov said of his brother.