The leaders of Malaysia and Australia have used warm and glowing terms to assure the world that their partnership in the desperate hunt for a missing airliner is built on a firm and abiding friendship. But it's also an odd-couple relationship that has proved brittle in the past and has been blighted by hostility, rivalries and cultural misunderstandings.

It has been a long time since an Australian leader accused Malaysia of being "barbaric," or since a Malaysian official offered a snide comment about Australia's origins as a British penal colony. And the countries appear to have recovered from a more recent tiff set off by Australian Prime Minister Tony Abbott's party when it was in the opposition.

"At this difficult time, Australia has proven an invaluable friend," Malaysian Prime Minister Najib Razak said last week during a visit to Australia, where he stood shoulder-to-shoulder with Abbott and inspected the headquarters of the multinational air and sea search of the southern Indian Ocean.

"Our nations are longstanding friends who work very well together and, to use the Australian term, we're good mates," Angus Houston, the former Australian defense chief who heads the search coordination center, told the Malaysian leader.

Malaysia, the country where the missing Malaysian Airlines plane was registered, officially runs the search, but Australia, which is closest to the plane's suspected location, is tasked with coordinating the effort.

Observers agree that the bilateral relationship has been in good shape for most of the past decade, since former Malaysian Prime Minister Mahathir Mohamad, a vocal critic of Australia and Western interests, ended his 22-year reign in 2003.

Relations chilled for years after Australian Prime Minister Bob Hawke condemned as "barbaric" Malaysia's execution of two Australian heroin traffickers in 1986. Kevin Barlow and Brian Chambers became the first Westerners to be hanged under Malaysia's tough anti-drug laws, and Mahathir had insisted they get no special treatment. Australia bars capital punishment, but Malaysia found its intervention insulting and insensitive.

Mahathir downgraded relations with Australia and canceled official visits in 1990, when his government took exception to a Australian TV series. "Embassy," which ran for three seasons, was set in a fictional Southeast Asian Muslim country; Malaysia considered it to be veiled criticism from a government-funded broadcaster.

In 1993, Hawke's successor Paul Keating described Mahathir as "recalcitrant" for boycotting the inaugural leaders' summit of the Asia-Pacific Economic Cooperation, an Australian initiative. Mahathir replied with a criticism of Australians' "lack of manners." He didn't demand an apology, but leaders in his government and Malaysian opposition figures escalated the war of words.

"What do you expect from a leader whose forefathers were ex-convicts and social discards?" asked Nik Abdul Aziz, premier of the opposition-led Malaysian state of Kelantan.

The dustup led Malaysia to ban Australian radio and TV broadcasts, and all commercials from its airwaves, cutting off millions of dollars in revenue. Malaysian students had been barred from attending 12 Australian universities. Weeks later, Keating eased tension and headed off threats of a trade war with Malaysia by saying he never intended to offend Mahathir.

More recently, Abbott has had to win trust from Malaysians since winning office at elections seven months ago.

In 2011, Abbott's conservative Liberal Party, then in the opposition, torpedoed a deal between the Australian government and Malaysia to effectively swap 800 asylum seekers who traveled to Australia by boat for 4,000 registered refugees living in Kuala Lumpur. It was Australia's plan to deter asylum seekers from making the voyage.

In justifying their stance, Liberal lawmakers attacked Malaysia's human rights record, its wielding of the rattan cane as state-sanctioned punishment and its disregard for the United Nations Refugee Convention.

In his first meeting as prime minister with Najib -- at the sidelines of the APEC leader's summit in Indonesia in October -- Abbott made amends.

"I offered an act of contrition, if you like, to Prime Minister Najib for the way Malaysia got caught up in what was a very intense and at times somewhat rancorous debate in Australia," Abbott explained to reporters in October. "I guess you might say that in my own way, I offered an apology."

Australia also offered Malaysia two retired navy patrol boats, to be delivered in 2015, to help stop asylum-seeker traffic.

Malaysia and Australia are free trade partners and share a defense alliance with three other member nations of the Commonwealth -- Britain, Singapore and New Zealand.

Tony Milner, an Australian National University expert on Malaysia, sees the occasional slanging matches as signs of strength.

"We've had at times quite robust relations, robust discussions with Malaysia, but that is largely because it's a quite close relationship," Milner said. "... It's simply a bit more frank, I think, than many of our other Asian relationships."

Ramon Navaratnam, chairman of Malaysia's Center for Public Policy Studies, said Malaysians do not judge Australia over such issues as criticisms made by Australian lawmakers in Parliament over Malaysia's human-rights credentials.

"Some individuals are a bit crude, but we do not judge a nation or a party because of a few rugged individuals," Navaratnam said.

"There is a lot of goodwill between the two countries due to education, migration and trade ties," he added.

Damien Kingsbury, an expert on Southeast Asia at Australia's Deakin University, sees rivalry at play between two middle-size former British colonies with economies that have outstripped most in their shared region.

Malaysia sees itself as a leader with an alternative vision for the dynamic region's future, while Australia, a predominantly white country that recently reintroduced the titles of knights and dames in its national honors, is perceived as "as being stuck in a neo-colonial past," Kingsbury said.

"Where they (Malaysians) have been annoyed in the past is Australia has taken on a slightly lecturing mode over some issues like deforestation, the treatment of indigenous people and so on," Kingsbury said.

"The Malaysians have turned around and said, not unreasonably, `Hang on, you haven't treated your own indigenous people too well, and by the way, the only reason you're telling us not to chop down our forests is because yours have all disappeared,"' he added. "'You've used yours to build your economy and now you're telling us we can't do the same, and that's hypocritical."'

But Kingsbury doesn't believe past differences will undermine the current cooperation on the search: "The bottom line is when you get to situations like we have at the moment, if someone holds out the hand of friendship, you don't bite it."