BEIJING—China's capital endured its worst air pollution in recent memory over the weekend, illustrating the persistent challenge the nation's new leaders face in addressing environmental woes.

Officials called for residents to stay home and avoid exercising outside after the murky air darkened the skies over Beijing and surrounding areas beginning Friday.

Beijing...