An Islamist was declared Egypt's first freely elected president in history in a divisive poll that highlighted the sharpening battle between the Muslim Brotherhood and the nation's secular military rulers over the political future of the Arab world's most populous state.