NEW YORK - President Barack Obama paid tribute to the 13 victims of last weeks shooting attack at Fort Hood military base in Texas, saying these are trying times for our country and no faith justifies the killings. This is a time of war, Obama said at a ceremony on the base. And these Americans did not die on a foreign field of battle. They were killed here, on American soil, in the heart of this great state, in the heart of this great American community. Obama reminded Americans of the cost of war brought on by the same extremists who killed nearly 3,000 Americans and who continue to endanger America, our allies, and innocent Afghans and Pakistanis. In Iraq, we are working to bring a war to a successful end, as there are still those who would deny the Iraqi people the future that Americans and Iraqis have sacrificed so much for, he said. Earlier, Obama and first lady Michelle Obama met with family members of fallen soldiers and with some of those wounded in the attack who are out of the hospital. The Defence Department and FBI are investigating the Nov. 5 massacre and the suspected shooter, Major Nidal Malik Hasan, an Army psychiatrist. Obama, in his speech, read the names of each of the 13 slain soldiers and vowed that their killer will be met with justice - in this world and in the next. No faith justifies these murderous and craven acts; no just and loving God looks upon them with favour, Obama said. Still, he added, the US is a nation of laws whose commitment to justice is so enduring that we would treat a gunman and give him due process, just as surely as we will see that he pays for his crimes. Obamas attendance at the memorial service comes as he is under pressure to decide whether to grant a request by his top commander in Afghanistan, General Stanley McChrystal, to send 40,000 more troops to the country. Obama will discuss four options for an Afghanistan troop buildup at a White House meeting tomorrow, spokesman Robert Gibbs told reporters traveling with the president. US counterterrorism officials said they detected communications between Hasan and a Muslim religious leader in Yemen known for his anti-American views. Anwar al Awlaki was the imam at a Falls Church, Virginia, mosque when Hasan and his relatives offered prayers there, an official said. The communications started last year and continued this year before the attack at Fort Hood, said the official. The messages didnt pose a threat and theres no evidence Hasan was ordered to launch an attack or had co-conspirators, the officials said at a briefing. The investigative officials said Hasan is expected to be charged in military proceedings. He is at Brooke Medical Centre in San Antonio and was still in critical but stable condition early today, according to hospital spokeswoman Maria Gallegos. General George Casey, the Army chief of staff, has said hes concerned that the shooting may lead to a potential backlash against Muslim soldiers. Obamas trip to Fort Hood prompted him to delay by one day a trip to China, Singapore, Japan and South Korea, his first journey to Asia as president. The Office of the Garrison at Fort Hood estimated 15,000 people attended the memorial service.