Yet two years after the government cleared the “Jungle,” in October 2016, there are still frequent police raids on migrant camps, and the lives of many seem stuck in limbo. The number of migrants in the Calais area has since dropped to 400 from 8,000. Many, including some who once lived in the Jungle and hoped to cross the English Channel, have decided to stay in St.-Omer.

They study, work or seek jobs and, in the case of some Soccs players, hope that their sport will help them establish themselves in the town of 16,000 people. St.-Omer has sheltered more than 5,600 since 2015, most of them in a center for underage refugees.

“Whenever young Afghans arrive in St.-Omer, one of the first things they ask is where they can play cricket,” said Jean-François Roger, the regional director of France Terre d’Asile, a state-funded organization that helps refugees. “Soccs gives them a framework. It helps them move forward and build something here.”

France is not exactly known for cricket, a sport played primarily in the former British Empire. It hardly figures in the national sports pantheon, with 1,800 cricket players in some 50 French clubs, compared with 2.2 million registered soccer players. Yet with the influx of migrants from Afghanistan, the number of cricket teams in northern France has grown to nine from two.

The Soccs are among them. In summer 2016, Mr. Ahmadzai and other Afghans were playing cricket with a homemade ball in a public park in St.-Omer when a local businessman who was out running, Christophe Silvie, stopped to ask them about the game. A few months later, Mr. Silvie and Mr. Ahmadzai founded the club with another volunteer living nearby, Nicolas Rochas.

The team practiced in a local gymnasium and won a first tournament. Then another.