Afghanistan 's first democratically elected Parliament in more than 30 years convened here on Monday with heavy security , and was sworn in before President Hamid Karzai , as well as the former king , Mohammad Zahir Shah , and foreign dignitaries .