The rule was, you showed up sober. You could drink yourself into oblivion on other days, but not Tuesday. Tuesday was soccer practice, and Carlos Fernandez did not want anyone playing drunk.

He knew that for some of the men — homeless Hispanic immigrants living in a patch of woods near Veirs Mill Road in Montgomery County — several hours without beer or booze or whatever it was that got them through the day was too much to ask. So he was a little surprised when about a dozen of them showed up, lucid and clear-eyed, ready to play.

That was three years ago. Fernandez has added another day of practice, Thursday, and then, after the guys started showing promise, signed them up for a Sunday recreational league. Soccer three times a week means three sober days.

The Montgomery players, decked out in light blue jerseys, joined 22 teams from 18 cities over the weekend for the fourth annual Street Soccer USA Tournament, a national event for the homeless held on the waterfront in Southwest Washington.

They came from Los Angeles and New York, St. Louis and Charlotte. Some of the players are living on the streets; others have recently found a place to stay. There were women from a Brooklyn homeless shelter who had never played soccer before, a former college soccer star from Charlotte who got caught up in drugs, a woman with bipolar disorder who spent a decade living on the streets after blowing an inheritance on who knows what.

“Many of them have never been on a team before,” said Lawrence Cann, founder of Street Soccer USA, a nonprofit group.

On the pitch, a group from New York huddled for a hands-in cheer before their match.

“They were always adults, many of them, since they were little,” Cann continued. “They had to fend for themselves. This is what they were never able to be a part of.”

Alvaro Gonzalez, though, remembers when he played soccer as a school kid in Nicaragua. Then he came to the United States — “Jan. 17, 1985,” he recalled.

He started drinking and smoking pot. He became isolated from his family, so he found another: the men living in the woods. Here was a fraternity that would share what little they had — a discarded cheeseburger, half-smoked cigarettes, 50-cent coffee purchased with begged-for change.

And beer, Gonzalez said, “always beer.”

“The only thing you can do is drink to forget about your problems,” he said.

Fernandez, a self-proclaimed minister, and a friend, Luis Romero, have started a group, Human Restoration Project, dedicated to helping the homeless. For years, the two have been hiking into the woods to bring the men food, clothing and scripture. Many of men do not speak English and are in the country illegally, so they don’t want to go to shelters because they fear deportation or arrest.

“Montgomery County is one of the richest counties, but they don’t want to admit they have homeless people,” Fernandez said.

It is not known how many Latinos are living in the Montgomery woods. But two years ago, the county did an informal survey and discovered 52 camps with a total of 642 homeless people in Rockville, Gaithersburg, Germantown, Silver Spring and Wheaton.

At one time, there were as many as 53 men living in the woods by Veirs Mill Road and Twinbrook Parkway in Rockville, Fernandez said. He and Romero would help them find lawyers when they were arrested and doctors when they were sick. They would drive them to day labor jobs and help them find shelter. But it was clear that the men in the woods needed something else.

So Fernandez set up the soccer practices, under his rules: No drinking, and three missed practices mean you’re off the team.

Since Gonzalez began playing soccer, he has gotten sober and started working as a handyman. He lives in his boss’s mother’s apartment rent free in exchange for taking care of the elderly woman.

Soccer, meanwhile, has taken the place of beer.

“You play, and you forget your problems,” said Gonzalez, who is 41 but looks older. “To me, when I’m playing, I don’t think about anything but the game. Nothing else matters.”

On Saturday, Fernandez was not worried that any of his players would show up drunk. The tournament meant too much to them. But there was one man from the woods who showed up wobbly and with glassy eyes.

“He still drinks,” Fernandez said.

And so he watched from the sidelines.