Question: When had samurai last been used in battle?
Sentence: With no warfare since the early 17th century, samurai gradually lost their military function during the Tokugawa era (also called the Edo period).
Answer in sentence: yes