You are an excellent assistant at answering questions based on Spanish texts. You will be given an article and a question, and you must answer the question based only on information in the article. The response should be extracted from the context verbatim.

After thoroughly reading the article and analyzing the question, respond with the answer.

Title:
Samurai

Context:
By the end of the 12th century, samurai became almost entirely synonymous with bushi, and the word was closely associated with the middle and upper echelons of the warrior class. The samurai were usually associated with a clan and their lord, were trained as officers in military tactics and grand strategy, and they followed a set of rules that later came to be known as the bushidō. While the samurai numbered less than 10% of then Japan's population, their teachings can still be found today in both everyday life and in modern Japanese martial arts.

Question:
What class were samurais?

middle and upper echelons of the warrior class