DOYRAN, Turkey — An invisible border line bisects the skinny Maritsa river, separating Turkey from neighboring Greece — but for a group of migrants on the Turkish side, it might as well be a concrete wall standing in the way of reaching the European Union country.

The migrant route to Europe that in 2015 erupted with people desperate to get to a safe haven had long been abandoned. Turkey shuttered its doors to Greece following a deal with the E.U. in 2016, in exchange for E.U. funds to help bear the financial brunt of the migrant crisis: Turkey today hosts over 3 million Syrians — more than any other country in the world.

But four days ago, Turkey abruptly announced it was no longer abiding by the deal. The decision followed the death of 33 Turkish soldiers in Syria’s Idlib, the last remaining rebel bastion where Turkish-backed rebel groups and Turkish armed forces are fighting a major battle against the Russian-backed Syrian army.

Almost immediately, thousands headed west. Buses in Istanbul’s migrant-heavy Fatih district waited at meeting points, filling up with mostly Syrians and Afghans. Text groups were created to provide details and answer questions: Are Turks allowing people without legal residency to cross? (Yes.) Are there buses going from other cities? (No.)

But dreams of living in an E.U. country with E.U.-awarded rights evaporated quickly: People found themselves facing off with a hostile Greek police force that pummeled crowds at the border gate with tear gas and rubber bullets. A video circulated showing one Syrian who had been fatally shot. People tried to cross the river instead, looking for weak points.

On Monday, amid barren trees, a Greek guard sat in a watchtower, making sure no people or dinghies enter the water. Across the border, a group of Syrian men waved at him — 21-year-old Abdul Malik Amour made a crude gesture in his direction.

The night before, between 10 p.m. and 2 a.m., the same outpost broadcast a message in Arabic over and over again: “Please return home.”

Amour is one of dozens stranded on the riverbanks of Doyran, a village three hours west of Istanbul. Some people have been waiting for four hours. Some have been waiting for four days.

Each has a reason for seeking refuge across the water, but most say racism and a lack of job opportunities are what’s driving them away from Turkey.

Getting to Greece means Amour could travel on to other E.U. countries. Getting to Greece means he could settle in a country like Germany and get benefits and set himself on the path to citizenship. But getting to Greece is more difficult than he initially thought — or more difficult than he was led on to believe.

Earlier in the day, Amour paid about $16 and boarded one of the widely advertised buses to the border crossing. Another dropped him off by the water 40 minutes away.

“They just told us you can cross the river and get to Greece. They didn’t give us any help,” he said.

Originally from Aleppo, Amour came to Turkey in 2014 when he was 15. When the migrant wave was at its high point the following year, his parents didn’t let him go. “They told me to wait, to be patient, that maybe things will get better, that maybe we’ll return.” But after six years of barely piecing a life together in a country where he feels unwanted, he jumped on the opportunity to leave.

Sitting in a circle on the ground, his friend nodded in agreement. “We just want to live a human life,” said Hussein, 23. Like others interviewed for this story, he declined to give his last name out of fear of retaliation. “We here are victims: victims of racism, of war, of death, of the river.”

He gestured at the families that dotted the lawn, protecting themselves from the cold with blankets the U.N. High Commissioner for Refugees had delivered. “These children, what will happen to them? These small children? These women? Can they swim? Can they cross? Can they walk thousands of kilometers?”

“I think we should go back to our houses in Turkey, it’s more honorable,” he said as he looked around at the group of young men. “They killed someone today. We’re human beings; we’re not animals.”

Another 21-year-old in the circle shook his head slowly. “I’ve been here for six years, and now that I’ve grown up, I understand the difficulties of this country,” Mazen said. “And I’m ready — I’m not going back home. I’m ready to die here. I am not going back home.”

Mazen says he feels like a pawn, that Turkey is busing people there “to pressure Europe over political issues.” But after years of feeling targeted for being Syrian, of dealing with bosses who refuse to pay him for work, he cannot tolerate living in Turkey anymore.

Over the years, Syrians in exile have been divided over their relationship with Turkey. Many, like Mazen, feel discrimination, but others have felt embraced by the country, settling down and finding jobs. Tens of thousands received Turkish citizenship. Sami, 49 and a father of four, feels gratitude toward the Turkish government for letting them in. But he says his 14-year-old son was bullied mercilessly in school — so much that they pulled him out two years ago.

Still, Sami said, “Turkey has only been good to us.” His wife Abeer interjected: “But the Turkish government should not have opened the border when it knows Greece won’t let us in.” She added that she believes Syrians are being used as international pressure to settle the issue of Idlib.

The family does not want to cross illegally. Ahmed, 35, made it across the river Sunday. He paid to cross in a dinghy but was caught by Greek police. They took his money, clothes, ID and phone, he said. He was beaten up, he said, showing a cut on his face. He was held at a detention center for two hours with many others before being driven back across the border.

“We don’t know what to do,” Sami said. “Do we cross? Do we go back?” The family sold their car cheaply four days ago, hoping the small amount will get them to Germany or Finland where their sons live.

“We’re living on the hope that we go from here to our kids,” Sami said. “We’re living on this hope, but this hope seems lost. It’s lost and we don’t know how to find it.”