In 1977, a constituent assembly was elected to draft a new constitution, which was published on September 21, 1978, when the ban on political activity was lifted. The military carefully planned the return to civilian rule putting in place measures to ensure that political parties had broader support than witnessed during the first republic. In 1979, five political parties competed in a series of elections in which Alhaji Shehu Shagari of the National Party of Nigeria (NPN) was elected president. All five parties won representation in the National Assembly. On October 1, 1979, Shehu Shagari was sworn in as the first President and Commander-in-Chief of the Federal Republic of Nigeria. Obasanjo peacefully transferred power to Shagari, becoming the first head of state in Nigerian history to willingly step down.