WASHINGTON — An American graduate student from Princeton University who had been imprisoned for three and a half years in Iran called on Monday for all nations to free their political prisoners.

The student, Xiyue Wang, was released by Iran on Dec. 7 in a prisoner swap in Switzerland. In exchange, the United States handed over Masoud Soleimani, an Iranian scientist. The exchange took place after weeks of negotiations involving diplomats in the United States and Iran, which do not have formal relations, and Switzerland, which regularly acts as an interlocutor between the other two powers.

In a statement, the first since that day, Mr. Wang and his wife, Hua Qu, a Chinese citizen, thanked the governments, individuals and organizations that helped in the release. The two also posted photographs showing Mr. Wang smiling with his 6-year-old son, Shaofan.

“Our family is doing well, and we are overjoyed and filled with deep gratitude for all the support we have received,” they said. “That said, our joy is tempered as our thoughts turn to all those who are still unjustly imprisoned and to their loved ones, who remain without them.”