The prime minister says it was a mistake that “deeply embarrassed parliament and Canada”.