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:
Indigenous_peoples_of_the_Americas

Context:
According to the 2002 Census, 4.6% of the Chilean population, including the Rapanui (a Polynesian people) of Easter Island, was indigenous, although most show varying degrees of mixed heritage. Many are descendants of the Mapuche, and live in Santiago, Araucanía and the lake district. The Mapuche successfully fought off defeat in the first 300–350 years of Spanish rule during the Arauco War. Relations with the new Chilean Republic were good until the Chilean state decided to occupy their lands. During the Occupation of Araucanía the Mapuche surrendered to the country's army in the 1880s. Their land was opened to settlement by Chileans and Europeans. Conflict over Mapuche land rights continues to the present.

Question:
How long were the Mapuche able to fight off the Spaniards?

350 years