He was once a close friend of Thaksin Shinawatra , the former prime minister , but the relationship soured and the huge demonstrations he organised in 2006 were instrumental in provoking the coup that removed Mr Thaksin from power .