Libya's interim prime minister Abdullah al-Thani stepped down on Sunday, saying that he and his family had been the victims of an armed attack the previous day, a statement said.