Two appliances and crews from Aylesbury and one from Thame attended, along with an officer.
There was a strong smell of smoke in the hallway, and a smoke alarm activating in a third-floor flat, when the firefighters arrived.
They extinguished a small fire in the kitchen of the flat.
One man and one baby were rescued. The firefighters provided them with immediate emergency care before they were handed into the care of South Central Ambulance Service.
The firefighters used a positive pressure ventilation fan to clear the smoke.