NEW YORK - US President George W Bush bid goodbye to Pervez Musharraf with a pat on his back for joining the United States in its war on terrorism, but the two White House contenders -- John McCain and Barack Obama -- did not share his praise for the Pakistani leader, who resigned his post as president on Monday. Meanwhile, Musharraf 's departure was widely welcomed by members of the large Pakistani community here. Many stayed awake till 3 am to listen to his address on some Pakistani television channels which reach the United States. Later, they exchanged greetings. Most newspapers on Monday carried the story under big headlines while the electronic media is full of coverage. President Bush , who always called Musharraf as his close ally, lauded his role in fighting Al-Qaeda and extremists, and said he is committed to a strong Pakistan that strengthens democracy and fights terrorism, the White House said. "President Bush is committed to a strong Pakistan that continues its efforts to strengthen democracy and fight terror," White House spokesman Gordon Johndroe said. "President Bush appreciates President Musharraf 's efforts in the democratic transition of Pakistan as well as his commitment to fighting al Qaeda and extremist groups," he said. "President Bush looks forward to working with the government of Pakistan on the economic, political and security challenges they face," Johndroe said in Crawford, Texas, where Bush is at his ranch. US Secretary of State said the United States will continue to help the Pakistani government fight extremism. "We will continue to work with the Pakistani government and political leaders and urge them to redouble their focus on Pakistan's future and its most urgent needs, including stemming the growth of extremism, addressing food and energy shortages, and improving economic stability," Rice said in a statement. "The United States will help with these efforts to see Pakistan reach its goal of becoming a stable, prosperous, democratic, modern, Muslim nation," she said. She said Washington was grateful to Musharraf for having chosen to join the fight against al Qaeda, the Taliban and other extremists. Meanwhile, in separate statements, the US presidential candidates, who have been squabbling over foreign policy, noted the vital role Pakistan plays in the US battle against global terrorism, but stopped short of praising Musharraf . Democratic candidate Obama said the United States must press the next Pakistani government to carry out a crackdown against Al-Qaeda and the Taliban. "There can be no safe haven for terrorists who threaten the American people," said, Obama, who once said he would be ready as president to strike against terror suspects in Pakistan if Islamabad did not act on US intelligence. "I have long said that the central terrorist threat to the United States lies in northwest Pakistan and Afghanistan, and not Iraq," Obama said. "A year ago, I advocated that the US move from a 'Musharraf policy' to a 'Pakistan policy," he said, calling on friends of Pakistan to use the president's departure to deal with extremism and food and energy shortages. Republican McCain said the resignation of Musharraf was a step toward moving Pakistan onto a more stable political footing." "Pakistan is a critical theater in countering the threat of Al-Qaeda and violent Islamic extremism, and I look forward to the government increasing its future cooperation," McCain said in a statement. The senators issued their responses hours after Musharraf quit to avoid impeachment after nine years of US-backed rule and a key role as a premier American anti-terror ally. "There are serious problems that must be addressed," McCain said. "The situation in Pakistan's frontier regions requires immediate and continued attention, and I hope that the elections for President Musharraf 's successor will serve to reconcile the Pakistani people behind a leader who can solidify their government internally. "It is critical that the United States continue to work in partnership with the Pakistani people and their democratically elected government to tackle the many challenges we both face."