Former attorney-general Christian Porter has resigned from the federal cabinet.

In a bid to keep the people who financially backed his legal battle against the ABC a secret, Mr Porter has stepped down potentially saving Prime Minister Scott Morrison from a devastating byelection.

Mr Porter promises to stay in the Federal parliament.

Mr Porter said he was assured none of the anonymous financial contributors were lobbyists or prohibited foreign entities but instead people who wanted to avoid retribution for supporting him.