Pelosi, 84, is the first woman to serve as speaker of the House and had also been a longtime leader of the House Democratic Caucus.