It is believed that the Matsunaga clan originated from Shinzei, the sixteenth generation from the ancestor TAKENOUCHI no Sukune, who had become a Kokushi official of Wakasa-no-kuni and therefore called himself Matsunaga KI, after Matsunaga no sho, the domain of Onyu, in Wakasa-no-kuni.
松永氏は祖先の武内宿禰から16世の孫真済が若狭国国司となり、同国遠敷郡松永荘より紀松永と称したことに始まるとされる。