The 21-year-old beat Spanish qualifier Cristina Bucsa 6-2 6-3 and said the win was "for my country".
On February 25, Yastremska wrote on Instagram that she and her 15-year-old sister, Ivanna, had been forced to leave their parents in Ukraine.
Three days later, the pair competed in doubles in Lyon.
They were beaten in the opening round, but Yastremska's impressive form continued with Italian fifth seed Jasmine Paolini waiting in Friday's quarter-finals.
In Monterrey, world number 15 Elina Svitolina battled past Bulgarian qualifier Viktoriya Tomova 7-6 (7-3) 3-6 6-2 to reach the quarter-finals.
Svitolina, who will donate all her prize money from the Monterrey Open to the Ukrainian army, said seeing her national flag in the crowd helped her during the two-hour match.
"Ukraine flag helped me a lot today to fight. I really fought until the end, and I found my game in the end," he said.
Djokovic gets French Open boost after vaccine rule change
Former world number 21 Yastremska described how she was "wake up by a bomb" in Odessa before crossing the Danube by boat to reach Romania.
He wrote on Instagram: "After spending two nights in an underground parking lot [a bomb shelter], my parents made the decision at any cost to send my little sister and I out of Ukraine!
"Mom, Dad, we love you so much, take care of yourself!"
Yastremska arrived on the pitch to face Busca with the Ukrainian flag on her shoulder and after her win said she felt the tournament was "very emotional".
"I'm still very nervous because I really want to win matches for my country," said the world number 140.
"I'm so happy that I'm here, that I'm in a safe place with my sister, and I'm happy to be doing what I love, playing tennis.
"Every point I've played here, I've enjoyed it a lot, and especially with the situation we have now, I've enjoyed it a thousand times over.
"This is another victory for me and another victory for my country."