When America was a little baby country, it started having some problems with pirates who were sailing around the ocean and taking American ships and people hostage. So America decided to make deals with the pirates to try and stop them from being so mean. These deals were called the Barbary treaties. They said that America would pay the pirates money so they wouldn't attack American ships, and the pirates promised to be nice and not kidnap any more Americans. The Barbary treaties helped America and the pirates get along better, but they cost the country a lot of money. Eventually, America became big and strong enough to fight the pirates and didn't need the Barbary treaties anymore.