On a cool May night, as the sun set over San Francisco in the distance, drummers and flag-waving fans led cheers of “Ohhhh-O-O-O Oakland” (to the tune of “Seven Nation Army” by the White Stripes) and “Let’s go, Oakland!” (clap clap, clap clap clap) as one of the city’s biggest sports teams pulled out a nail-biting victory.

But the nearly 4,000 fans were not in Oakland, and they were not cheering for a team from one of the major American professional sports leagues. The setting was a rented college stadium in nearby Hayward, and the game was a home match for the Oakland Roots, a soccer team that plays in the U.S.L. Championship, a second-tier league. The Roots defeated Orange County S.C., 2-1, on a late goal, before making the journey back home up Interstate 880.

At the same time, 20 miles north, construction workers were racing to put the final touches on a $1.6 million renovation of Raimondi Park, a city park in West Oakland. The park’s previously run-down baseball field was being transformed into the home of the Oakland Ballers, an independent league team that began competing this summer.

Oakland has had an exodus of sports teams over the past half decade. The Warriors of the N.B.A. moved across the bay to San Francisco, the Raiders of the N.F.L. decamped for Las Vegas, and, after this season, the Athletics will play their next three or more Major League Baseball seasons in Sacramento while they settle on a permanent home. In a city that once had three teams from the country’s major sports leagues, there will soon be none. (A new W.N.B.A. franchise, the Golden State Valkyries, will begin play next season … in San Francisco.)