DAMASCUS, Syria—An American who came to Syria on foot and in search of religious fulfillment instead found himself a captive in one of the Assad regime’s most brutal prisons—alongside political prisoners and torture victims.

The man, who gave his name to Syrian authorities as Travis Timmerman, said he came to the Middle East on a religious pilgrimage after traveling in Europe.

On Thursday, he was found walking barefoot on a road south of Damascus where locals took him in and then handed him over to rebel authorities . He had been freed from a Syrian prison during the overthrow of President Bashar al-Assad .

In an interview later Thursday, the man, who said he is from Missouri, recounted how he had walked into Syria over the border from Lebanon in late May, when he was arrested by Syrian security forces. He said he was interrogated for 3½ hours before being detained in the so-called “Palestine Branch” of Syrian intelligence in Damascus.

The facility is known in Syria as one of the harshest in Assad’s network of detention centers . Former detainees said they had been held in coffin-like cells, deprived of food and water and sexually humiliated, according to a United Nations commission report published last year.

Speaking in a Damascus hotel room where he sat barefoot on the bed, the man identified as Timmerman said he thought the Assad government had been holding him as leverage over the U.S., as a “political token.” Until Thursday, his detention hadn’t been public knowledge. He said he preferred to go only by the name Travis, which he said was given to him by God in a dream.

The man said he was held in a cell by himself and heard daily beatings of other detainees during the seven months he was held in the country.

A video on Thursday showed men speaking Arabic alongside the man and claiming he was Austin Tice, an American journalist detained in Syria for more than 12 years. The U.S. has issued a $1 million reward for help returning Tice , and people in the village where the man was found said his name was Austin Tice. A person close to Tice’s family said the man in the video wasn’t their relative.

He was one of thousands of prisoners released from regime prisons by rebel forces who surged into Damascus last weekend, deposing Assad and opening an opportunity for Syrians to take stock of years repression under his rule, including abduction, torture and executions that he used to suppress an uprising against him.

“Hearing the beatings of other prisoners, there was an undercurrent of violence in the prison, so it was implicit that it could come to that, but it didn’t for me,” the man said.

He is now expected to be handed over to U.S. officials in the region.

“We are working to bring him out of Syria and to bring him home,” Secretary of State Antony Blinken said Thursday, declining to provide additional details about the individual citing privacy reasons.

Inside the prison where the man was held, the beatings took place next door to his cell, he said. Some prisoners, always men according to his recollection, were singled out for extra mistreatment due to acts of defiance, he surmised.

Held for months with little contact with the outside world, he said he could hear explosions in October, around the time of Israel’s stepped-up offensive against the Lebanese Hezbollah movement, which included intensified airstrikes in Syria.

“I lost track of time, so I started counting Wednesdays” to measure the passing weeks, he said without elaborating.

The Missouri State Highway Patrol said in May that a 29-year-old man named Pete Timmerman had gone missing. Police in Budapest later said in August they were looking for information on his whereabouts.

While in Syrian prison, the man said he wasn’t allowed contact with his family until a few weeks ago when he was allowed to use a phone to call them. Not wanting to worry his mother, he said he was in Hungary, referencing his earlier travels in Europe, which included a stop in the Czech Republic.

After rebels beat down the door of his cell using hammers early Monday morning, he left prison among dozens of others, mainly women, he said. He spent days wandering around Damascus before walking south aiming to continue his religious journey in Jordan, he said.

Roger Carstens, the U.S. hostage envoy, was in Beirut this week in part to help find Tice or other Americans who were held in Syria under Assad.

U.S. officials said they have communicated through back channels to Hayat Tahrir al-Sham and the other groups operating in Syria that Tice’s safe return is of utmost concern to the U.S.

“Every single day we are working to find him and bring him home, making sure that the word is out to everyone that this is a priority for the United States,” Blinken said.

Some Syrians saw the American man’s release as another piece of the picture now emerging of the horrors of Assad’s prisons, a tool in his campaign of repression against opponents.

“Maybe there’s more than one American in the prisons,” said Rabia al-Ali, 33, a resident and former prisoner from Al-Thihabiyeh, the town where the man was found on Thursday. “Anyone who said a word of the truth went to prison.”

Write to Jared Malsin at jared.malsin@wsj.com