The association of Artificial Intelligence (AI) and education has attracted researchers’ attention, as it is very beneficial for learners affecting the whole teaching procedure. ChatGPT, an AI language model developed by OpenAI and based on the Generative Pre-trained Transformers (GPT)-3.5 architecture, though newly introduced in November 2022, became very popular even within the first two months. Researchers have already explored and acknowledged the affordances of ChatGPT for language learning and teaching. In this context, the study aimed to examine the effectiveness of ChatGPT as a feedback tool on foreign language writing, especially for socially vulnerable populations, such as refugees/migrants, who face extra language difficulties. The study was conducted in a Junior High School (Gymnasium) classroom in an urban city in south Greece, which consisted of 8 students with a migrant/refugee background aged 15 years old who were attending German as a foreign language learning. The focus of the study was to analyze how the use of ChatGPT could improve foreign language writing in terms of vocabulary and grammar. After the students' first writing attempt, we asked ChatGPT to enhance the vocabulary and grammar of the texts. In contrast, the students received an improved version in terms of language and grammar, and then, they were asked to produce another writing piece of work on a similar topic to their first attempt. The study results indicated an increase in the total number of words, the unique words and the average word number per sentence in the improved version of their work. Overall, the study results were promising, indicating that ChatGPT could act as a language learning tool and support the teaching procedure, especially for students with a refugee/migrant background. However, further research is needed to investigate its use and effectiveness in diverse contexts.