When did Rome occupy Sardinia?

Rome occupied Sardinia after the Mercenary War. Throughout the war, Rome was given the chance to take control of Sardinia but declined. Homwever, at the end of the War (237) Rome changed its mind and took control of the island. This did not appeal to Carthage and may have been one of the causes of the second punic war.