The gleaming artificial-turf soccer stadium in the hills above this picturesque town, tucked along the southwest shores of volcano-ringed Lake Atitlán, may be a paean to a soccer-loving culture.

But visible almost everywhere along San Pedro’s steep serpentine pathways are signs of a seemingly unlikely affair with another sport: basketball.

Basketball hoops are as much a part of the tableau of this town of 12,000 as the pat-pat-pat sound of women slapping tortillas into shape in storefronts. They are there in schoolyards, at an indoor gym, inside a car repair garage, adjacent to a bus depot and on the edges of the lake, whose rising waters have claimed a court, but not yet its backboards and rims.

The most favored court is at the center of town, shoehorned among the market, a school, government offices and a Catholic church. On a recent Saturday night, about 800 people gathered there — men, women and children stacked seven or eight deep around the edges of a concrete court.

As the evening unfolded, first came the women’s championship and then the men’s, both accompanied by an enthusiastic play-by-play announcer and vendors selling freshly squeezed fruit juices and chocolate-covered bananas.

This sort of basketball fiesta would not have seemed out of place at a renowned hardcourt like Rucker Park, in Harlem, or at the beach courts in Venice, California, where basketball’s roots run pure and deep.

“It’s not like fútbol,” Otto Gonzalez said as he watched his daughter play one afternoon. “But basketball is important in Guatemala, especially in some of the towns around here.”

Yet in a country where soccer is king and growing to 6 feet ensures you will tower over most crowds, basketball’s increasingly global appeal has helped the sport secure a foothold, particularly in indigenous communities in the central highlands.

The sport’s popularity in this region can be traced to several factors: The arrival of cable television in the late 1980s brought the NBA into people’s homes; carving out enough flat land for a basketball court is far easier than creating a soccer field in a region rife with hills, mountain ridges and volcanoes; and the art of putting a ball through a hoop can be traced to an ancient Mayan game.

Basketball has resonated with other indigenous cultures — Native Americans in the United States have put their own stamp on the game, nicknamed rez ball, and the Triqui in southern Mexico, who grew up playing the game barefoot, have gained notice for their proficiency at it.

So it is, also, for the Tz’utujils, who live here on the south shore of Lake Atitlán. Many recognize the connection to el juego de pelota (ballgame), a Mayan sport in which players had to use their shoulders and thighs to put a ball through a vertical hoop.

“Other than turning the hoop, they had the right idea,” said Richard Hansen, an archaeologist who has studied Mayan culture in Guatemala since the late 1970s. “Running a rubber ball through a hoop — that appeals to them. There’s a skill involved, and practice and team coordination. These are things that expand on the ancient past, so there’s a tremendous legacy there.”

Mauricio Garcia, 39, sees himself as a steward of this legacy.

Garcia, his age notwithstanding, is the best basketball player in town. At 6-foot-1, he soars over everyone else on the court, and his dribbling and shooting skills explain why he was invited nearly 20 years ago to train with the national team — an opportunity he said he declined because it would have required him to move to Guatemala City, which he could not afford to do.

Basketball was a savior for Garcia at a young age, when his father’s drinking became a burden for his family. Garcia immersed himself in the sport, in part because he hoped to win his father’s admiration and because, as a Mayan, he felt a connection to the game.

“Maya have a way of seeing the world,” Garcia said. “This is my inspiration.”

Throughout Guatemala, where 53.7 percent of the people live below the poverty level, there has been in recent years a re-embrace of Mayan culture, including the calendar and the belief system. At the same time, globalization has brought outside influences, particularly from migrant workers who have returned to Guatemala.

Basketball, then, is a link to the present — and the past.

“For 500 years, they’ve been oppressed, denied rights, slaved in the coffee field and have had no opportunity to appreciate the rich history they have,” Hansen said. “Basketball is a game where they have an opportunity to appreciate the history they’ve had. Their ancestors essentially invented it.”

Basketball here also serves as an outlet for women and girls. It is as common to see school-age girls in plaid skirts and white blouses playing the game in the town center as it is to see their male peers, and the women’s championship drew nearly as big a crowd as the men’s game that followed.

Girls are generally discouraged from playing soccer, typically by their fathers, who view it as a male domain, said Clarinda Chavajay, a physical education teacher in San Pedro.

“Fathers tell girls that basketball is more appropriate for women,” Chavajay said.

About a five-minute walk from the town center sits an 8-year-old gym with a concrete court, a seating capacity of close to 1,000 and an electronic scoreboard — a basketball palace by Guatemalan standards. But on the night of the championship, it was closed.

The players preferred to compete outdoors, in the center of town, where children are perched atop the marketplace wall, the scoreboard is manually operated, and play is occasionally interrupted when a dog runs onto the court.

The court has a history. When Pedranos, as the townsfolk are called, became acquainted with Larry Bird, Magic Johnson, Michael Jordan and the diminutive slam-dunk champion Spud Webb — after cable television arrived — baskets were put up on what for several years remained a dirt patch.

When Guatemala’s 36-year civil war ended in 1996, playing past 8 p.m. was no longer prohibited. But the games did require lights, which meant screwing in bulbs on a string of outlets that hung alongside the court. After games, the bulbs were removed and stored for safekeeping. Now there are four floodlights, one in each corner of the court.

There have also been intermittent efforts by local government officials to annex the court for more market space.

“Every four years they try to make it a marketplace when they change the government, and every four years the people say no,” Gonzalez said. “The people are working very hard to keep it this way.”

The annual tournament, which began in 1999, is played from late November until early January, which coincides with the dry season and with a break in the academic calendar, which allows university students who have returned home to participate.

Although the women’s championship was a rout, the men’s game was compelling. It pitted Garcia’s team, Ta, which means “old men” in Tz’utujil, against Boca Juniors, a team wearing Chicago Bulls-replica uniforms. The Boca squad featured three Gonzalez brothers — Juan Jr., Kevin and Mariano — along with their father, 52-year-old Juan Sr., who had assembled the team to honor his wife and the boys’ mother, who died last year.

While Garcia often served as a one-man team, the Gonzalez brothers and their teammates whipped the ball around the court, ran at a frenetic pace and played with great savvy. They were clearly the crowd favorites.

When Juan Jr., a barrel-chested 5-foot-5 guard, sank 3-pointers and delivered slick no-look passes, the fans cheered, and when he froze Garcia with a flurry of between-the-legs dribbles, their whistles taunted Garcia. He led his team back from a 16-point deficit, but the Gonzalezes held on. When Juan Sr. entered the game in the final minutes, after his youngest son, 15-year-old Mariano, had fouled out, he drew cheers as he sank a series of free throws.

When the game ended, the players all embraced, and Garcia, who had coached the Gonzalez boys when they were growing up, offered his congratulations. Then the Gonzalezes took to the stage at the end of the court, where their father gave an emotional address to the remaining crowd.

A few minutes later, as he lingered on the court, he gave the impression of a man who did not want the evening to end.

“I’m so happy,” he said. “It’s such great satisfaction for me to have three sons play. It’s a way for us to stay together."