Containing merchandise from all corners of Asia, the thriving markets of Ayutthaya attracted traders from Europe. The Portuguese were the first to arrive, in 1511, at the time when Albuquerque was attempting to conquer Melaka (Malacca). They conclu ded their first treaty with Ayutthaya in 1516, receiving permission to settle in Ayutthaya and other Thai ports in return for supplying guns and ammunition to the Thai king. Portugal's powerful neighbor Spain was the next European nation to arrive in Ayutthaya, towards the end of the 16th century. The early 17th century saw the arrival of two northern European East India Companies: The Du tch (V.O.C) and the British. The Dutch East India Company played a vital role in Ayutthaya's foreign trade from 1605 until 1765, succeeding in obtaining from the Thai kings a deerhide export monopoly as well as one of all the tin sold at Nakhon Si Thammarat. The Dutch sold Thai sapanwood and deerhides for good profits in Japan during Japan's exclusion period, after 1635.