The invitation was extended during a telephone conversation in the United Arab Emirates where President Ghani was on an official visit on Thursday, according to the statement, reported Xinhua news agency.
The Palace spokesman Sediqqi tweeted that President Ghani briefed Trump about his "seven-point peace plan" for the Afghan government, and US President emphasized the need for a ceasefire as a precondition for peace.
Trump also said that for the peace process to succeed the Afghan government's management and involvement are needed and must begin from now on, reported Tolo news.
"During the talks the US president expressed gratitude to Afghan President Ghani over his cooperation in releasing two professors of American University of Afghanistan (AUAF) and also praised Afghan security forces in defeating the Islamic State group's fighters in the eastern Nangarhar province," the statement further said.
More than 600 members of the Islamic State group and their families including women and children have surrendered to security forces in Nangarhar province in Afghanistan over the past couple of weeks, according to officials.
The Taliban outfit set free two lecturers of AUAF including an American and an Australian on Tuesday as part of the prisoners' swap for three high-level Haqqani group's leaders to accelerate the peace process in Afghanistan.