TAMPA, Fla. — Jill and Scott Kelley moved here about a decade ago, taking up residence in a huge redbrick home with a spectacular view of the water on Bayshore Boulevard, the city’s most fashionable street. They quickly established themselves as social hosts to the powerful four-star officers who run two of the nation’s most important military commands.

The Kelleys were known for their lavish parties, with extravagant buffets, flowing Champagne, valet parking and cigars for guests from nearby MacDill Air Force Base, including David H. Petraeus and Gen. John R. Allen, who now commands troops in Afghanistan. “Tampa is the kind of community where, if you’re new to the community, you can carve out your own niche,” said Pam Iorio, the city’s former mayor, who recalls mingling with Mr. Petraeus and his wife, Holly, at the Kelleys’ home. “They decided to carve out a niche with the military.”

Now the social link between Tampa’s military and civilian elite is at the center of an unfolding Washington scandal that has already cost Mr. Petraeus his job as director of the Central Intelligence Agency and has ensnared General Allen, who was Mr. Petraeus’s deputy when he was here from 2008 to 2010.