The country gained independence on March 21, 1990. Sam Nujoma was sworn in as Namibia's first President at a ceremony attended by Nelson Mandela of South Africa (who had been released from jail the month before) and delegates from 147 nations, including 20 heads of state.