This task involves creating answers to complex questions, from a given passage. Answering these questions, typically involve understanding multiple sentences. Make sure that your answer has the same type as the "answer type" mentioned in input. The provided "answer type" can be of any of the following types: "span", "date", "number". A "span" answer is a continuous phrase taken directly from the passage or question. You can directly copy-paste the text from the passage or the question for span type answers. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words. A "number" type answer can include a digit specifying an actual value. For "date" type answers, use DD MM YYYY format e.g. 11 Jan 1992. If full date is not available in the passage you can write partial date such as 1992 or Jan 1992. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words.

Passage: This time, Pagan could not do anything to retake Martaban because it was facing an existential threat from the north. The Mongols demanded tribute, in 1271 and again in 1273. When Narathihapate refused both times, the Mongols systematically invaded the country. The first invasion in 1277 defeated the Burmese at the battle of Ngasaunggyan, and secured their hold of Kanngai . In 1283-1285, their forces moved south and occupied down to Tagaung and Hanlin. The king fled to Lower Burma in 1285 before agreeing to submit to the Mongols in June 1286. Soon after the agreement was finalised, the king was assassinated in July 1287. The Mongols once again invaded south toward Pagan. Recent research indicates that Mongol armies may not have reached Pagan itself, and that even if they did, the damage they inflicted was probably minimal. But the damage was already done. All the vassal states of Pagan revolted right after the king's death, and went their own way. In the south, Wareru, the man who had seized the governorship of Martaban in 1281, consolidated Mon-speaking regions of Lower Burma, and declared Ramannadesa independent. In the west too, Arakan stopped paying tribute. The 250-year-old Pagan Empire had ceased to exist.
Question: How many years went by between the first invasion and the king submitting to the Mongols?
Answer type: Number
9.