The provinces were a Malay sultanate until Buddhist Thailand annexed them a century ago .