A ninja (忍者, Japanese pronunciation: [ɲiꜜɲdʑa]) or shinobi (忍び, [ɕinobi]) was a covert agent or mercenary in feudal Japan. The functions of a ninja included espionage, deception, and surprise attacks. Their covert methods of waging irregular warfare were deemed dishonorable and beneath the honor of the samurai. Though shinobi proper, as specially trained spies and mercenaries, appeared in the 15th century during the Sengoku period, antecedents may have existed as early as the 12th century.