De Klerk cut short a visit to Europe over the weekend because of Mandela's ailing health, only to fall ill himself. The 77-year-old felt dizzy after his return from Europe on Sunday and saw his physician.
"The specialist recommended immediate installation of a pacemaker," his spokesman Dave Steward told AFP.
"It's a routine procedure. He will spend the night in hospital."
De Klerk will receive the device, which helps the heart beat at a normal rate, in a Cape Town hospital.
More From This Section
Sometimes heated talks between the two and their factions in the end brought about the first all-race elections in 1994 which propelled Mandela to power.
The two men shared the 1993 Nobel Peace Prize for their efforts.
At a prayer meeting in downtown Johannesburg today, organised by the ruling African National Congress, hundreds of supporters gathered to wish Mandela well.
"Growing old is not a curse -- it's a blessing," ANC secretary-general Gwede Mantashe told the crowd outside the organisation's headquarters, which was adorned with a huge poster of Mandela.