BIRMINGHAM, Ala. — The word traveled, urgently and insistently, along the informal networks of black friends, black family and black co-workers: Vote.

Joanice Thompson, 68, a retired worker at the University of Alabama at Birmingham, scrolled Tuesday through the text messages on her phone from relatives reminding each other what needed to be done. Byron Perkins, 56, a trial lawyer, said his Facebook feed was clogged with photos of friends sporting the little “I Voted” stickers given out at polling places. Casie Baker, 29, a bank worker, said her family prodded and cajoled and hectored each other until the voting was done.

The message was largely received: African-American voters played an essential role in electing the Democrat, Doug Jones, over his scandal-scarred Republican rival, Roy S. Moore, in a special election on Tuesday for an open Senate seat that proved to be one of the most shocking upsets in recent memory.