The US Secretary for Homeland Security delivered the message during a ceremony to commemorate the 70th anniversary for the Battle of the Coral Sea in Brisbane on Saturday.
The naval and air battle between the Allied and Japanese forces in 1942 was fought between May 4 and 8, 1942 in the Coral Sea, off the coast of Queensland.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
It was credited with stopping the Japanese advancing south towards Port Moresby, in Papua New Guinea, and Australia.
With heavy security on hand, US and Queensland dignitaries gathered at an Australian-American war memorial on the banks of the Brisbane River at Newstead.
In his letter, Mr Obama said the ceremony reaffirmed the strong bond between Australia and the US and honoured the servicemen who fought in the battle.
"We will never forget their sacrifice and we will always honour the legacy of those who fought to keep us free," he said.
US Homeland Security Secretary Janet Napolitano said the Battle of the Coral Sea was one of the most significant engagements involving US and Australian forces over the past 100 years.
Ms Napolitano said it was the largest naval battle ever fought in Australian waters and was for many the battle that saved the nation.
"The wreaths that we lay today remind us of the sacrifices by our fellow countrymen, American and Australians alike, and their courage, bravery and determination to achieve victory whatever the cost," she said.
Wreaths were laid at the foot of the memorial by Ms Napolitano, Labor Senator for Queensland Claire Moore on behalf of the prime minister, Queensland Premier Campbell Newman and Queensland Governor Penelope Wensley.

