The Yamato sword is a demonic-powered Katana. It has been used in Devil May Cry 3 and Ultimate Marvel vs. Capcom 3 by Vergil and in Devil May Cry 4 by Nero.
Devil May Cry 3 Main Article
The Yamato's origins are currently unknown, but its first owner was the Legendary Dark Knight Sparda. He passed on this sword to Vergil and his Rebellion to Dante respectively. The sword suits Vergil's noble fighting style, one who considers those who uses guns not a true warrior. Its latent demonic power is what activates Vergil's devil trigger, putting his power on par with his brother's devil trigger. Incidentally, because of Vergil's ties with the demon world as opposed to the human world, his DT is activated some time before Dante. Using Yamato gives Vergil access to the Darkslayer style which features unique abilities from Dante's six other styles.
In Devil May Cry 3, Vergil uses the Yamato with deadly accuracy, catching bullets, lining them up and hiting them with the same amount of power as if they'd have just been fired from the guns they came from. As a boss he uses these skills to cause the player many problems.
The last time Vergil is seen wielding the sword is in DMC3's secret ending in which he duels with Mundus, but when Vergil loses the fight, his mind and humanity (and goes on to become Nelo Angelo who dante fights in Devil May Cry), he loses the sword as well.
Devil May Cry 4 Main Article
The Yamato is used by Agnus before the events of Devil May Cry 4 during his Angelo experiments. Where it was found is unknown but despite being broken in two it greatly improves Agnus' research into opening demon gates and binding demon souls. When Nero arrives and promptly fends off everything Agnus throws at him his demon arm resonates with the Yamato, restoring it and awakening an Angelo-like Devil Trigger in Nero. The arm then absorbs the sword into its being and provides support for Nero for the rest of the game.
Dante briefly acquires the sword, utilising the Darkslayer style his brother uses before thrusting it through the Saviour's chest for Nero to use in the final battle again the Sparda-wielding Sanctus. Despite the power of the legendary sword Sanctus' mere transformed human form is no match for Nero's combination of demonic power and Yamato.
Following the events of DMC4 Nero keeps the Yamato, entrusted to him by Dante and will most likely return in the series as long as Nero does.