Italian Prime Minister Mario Draghi resign on Thursday evening, his office said in a statement.

He made the announcement despite passing a confidence test in Italy's parliament earlier on Thursday.

His victory in the vote on a package of measures to help with the cost of living was 172 votes in favor and 39 votes against.

However, his coalition partners from the 5-Star Movement boycotted the vote.

"I would like to announce that this evening I will hand in my resignation to the President of the Republic," Draghi said in a statement.

"Today's votes in Parliament are very important from a political point of view.

The majority of national unity that has supported this government since its formation is no longer there," he added.