A Hingham native held in an Iranian prison for more than 40 days spoke about the ordeal for the first time Wednesday night. 

Matthew Trevithick was in Iran studying the country’s language. 

When he walked out of the dorm where he was staying one day, three men came up to him. After asking him what his name was, they put him in a car and headed to one of Iran’s most notorious prisons. 

"I was arrested on the street, just walking down the street on my way to buy my ticket to come home," Trevithick told CNN’s Anderson Cooper. 

Trevithick said within an hour of standing on the street he was sitting in an interrogation cell in an Iranian prison. 

"Their very first sentence to me was, ‘Do you know Jason Rezaian?’ I said, ‘Of course. The whole world knows Jason Rezaian. Everybody knows that name,’ and you know, they were pacing behind me, the prayer beads clicking in his hand and he said, ‘He’s never leaving and neither are you.’"

In the interview, Trevithick said he was charged with personally trying to overthrow Iran’s government. 

"I was accused of having access to bank accounts with millions of dollars and I was accused of knowing the locations of weapons caches," he said. 

The 30-year-old was held for 41 days, 29 in solitary confinement. He said the scariest part of his ordeal was the final two hours before he was released. 

"I was kind of violently pulled out of my cell, rushed down to the basement," he said. 

It was there that he was interrogated for a final time. 

"They said Matthew, Matt, this is your last chance. Admit why you are here. Admit that you are here to overthrow the government," he said. "I look right in the camera and I say, ‘I’ve said everything I have to say.’"

Trevithick was taken back to his prison cell, where he was told to collect his belongings and, to his surprise, he was taken to the exit and met by two Swiss diplomats. 

"One of them said, ‘We’ll go now. Get in the middle seat,’ and the car took off a 100 miles per hour toward the airport," he said. 

Trevithick arrived back in Boston last week. 

He said he went to his favorite burger place when he got home and said he looks forward to seeing the new "Star Wars" movie. 

(Copyright (c) 2016 Sunbeam Television. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox