NICODEMUS, Kan. — Riding a red lawn mower down Washington Avenue in her hometown’s annual parade, Bertha Carter, 82, shielded herself from the sun with a white cowboy hat, and dispatched giant mosquitoes with an electronic swatter.

As Ms. Carter motored along, pulling several children on a makeshift train behind her mower, she drew applause from the hundreds of people drawn here for a weekend-long homecoming celebration in Nicodemus, the country’s oldest black settlement west of the Mississippi River.

Ms. Carter is among a dwindling number of Nicodemus’s permanent residents, who total no more than 25 by most estimates. But each summer, for a few sweet days, the town’s population swells for the homecoming. Children whose ancestors settled this land in the 1870s use the swings on a playground that often sits idle. Cousins snack on catfish sandwiches and play basketball on the court next to Township Hall. Old men and women reminisce about their childhoods, discuss the joys and hardships of rural life in northwest Kansas, and ponder the future of this proud town, one that boomed, went bust and held on.

“I hope it keeps going,” said Ms. Carter, who said she stayed here all these decades because “it’s home and I don’t like cities.”