* Trump says Turkey has been treated unfairly
* Erdogan welcomes Trump comments
* Says Russian system will be delivered in July
* (Recasts with Erdogan, adds Trump, details)
By Roberta Rampton and Tuvan Gumrukcu
OSAKA/ANKARA, June 29 (Reuters) - Turkish President Tayyip Erdogan said on Saturday the United States did not plan to impose sanctions on Ankara for buying Russian defence systems, after the U.S. president said Turkey had not been treated fairly over the contract.
The NATO allies have been at odds over Turkey's decision to procure the Russian S-400 missile defence systems, with Washington warning of sanctions if the deal goes through.
Russia's Interfax agency on Saturday quoted a Kremlin spokesman as saying that the deal envisaged a partial handover of technology.
Turkey has said it would not back down before the early July delivery date, further testing relations that are already strained over a host of other issues.
But in contrast to statements by U.S. officials, Donald Trump said Turkey had been treated unfairly over its decision to buy the S-400s and blamed the "mess" on the administration of former President Barack Obama. Trump did not rule out sanctions.
Speaking shortly after bilateral talks with Trump at the G20 summit in Japan, Erdogan said that the S-400s would be delivered in the first half of July, adding he had heard directly from Trump that there would be no sanctions.
"We have heard from him personally that this would not happen," Erdogan said. "We are strategic partners with the United States. As strategic partners, nobody has the right to meddle in Turkey's sovereign rights. Everyone should know this."
Earlier, asked if the United States would impose sanctions on Turkey, Trump, sitting alongside Erdogan, said the issue was being discussed, but it was a "two-way street" and both sides were evaluating "different solutions".
The United States says the S-400s are not compatible with NATO's defence network and could compromise its Lockheed Martin F-35 stealth fighter jets, an aircraft Turkey is helping to build and planning to buy.
Under possible U.S. sanctions, Turkey could face expulsion from the F-35 programme, a move Erdogan has dismissed. But Washington has already started the process of removing Turkey from the F-35 programme, halting training of Turkish pilots in the United States on the aircraft.
"We have a payment so far of $1.4 billion to the United States," Erdogan said. "As joint producers, until now four F-35 jets have been delivered to us, but we will still receive... a total of 116 jets. We are expecting these," he added.
"What some people in lower ranks are saying absolutely do not align with Mr Trump's approach. I believe these will not harm our bilateral ties, and that is the commitment we are going on with."
Despite the threat of sanctions, Turkey had put its hopes on the relationship between Erdogan and Trump, saying it expected the U.S. president to protect it from sanctions over the S-400 deal.
Ahead of Saturday's talks, the meeting between Erdogan and Trump was seen as Turkey's last push to avoid U.S. sanctions that could significantly damage its already ailing economy.
Even minor U.S. sanctions could prompt another sharp sell-off in the Turkish lira. A 30% slide in the currency drove the economy into recession last year, and the lira has lost another 10 percent this year.
Erdogan's comments also appeared to go beyond statements made by the Turkish presidency and the White House after the talks between the two leaders, which lasted around 40 minutes.
The White House said Trump "expressed concern" over the S-400 deal and "encouraged Turkey to work with the United States on defence cooperation in a way that strengthens the NATO alliance", while the Turkish presidency said Trump had voiced a desire to resolve the dispute without harming bilateral ties.
In an effort to sway Turkey, the United States has offered to supply it with Raytheon Co Patriot missiles, but Erdogan has said the U.S. offer was not as good as Russia's S-400 proposal.
Speaking at a news conference at the G20 minutes before Erdogan, Trump blamed Barack Obama's administration for placing conditions on Turkey's purchase of Patriot missiles and treating Turkey unfairly, and added Erdogan had no fault in the dispute.
"This administration previous to mine would not let him buy it (Patriots). So (Erdogan) goes out, he goes to Russia, and makes a deal for the S-400," Trump said. "He made a deal, he paid them a lot of money, put up a lot of money. And he bought it."
"As soon as he bought it (S-400), people went back to him from our country and they said, 'Listen, we don't want you to use that system because it's not the NATO system," he added. "He got treated very unfairly."
Trump also said he would visit Turkey, but added that a date had not been set yet. Erdogan said earlier this week that Trump may visit in July. (Additional reporting by Maria Vasilyeva in MOSCOW, Malcolm Foster and Chang-Ran Kim in TOKYO; Editing by Robert Birsel and Stephen Powell)