The Trojan War lasted slightly more than 10 years. During the first nine years, the Greeks fought against the Trojans and its neighbors to attempt to cut off Troy's supplies and gain an advantage.
The city of Troy was protected by its walls. The Trojan horse, which was built by Odysseus, is credited with ending the Trojan war by allowing the Greeks to gain access to the city. The Trojans dragged the horse into the city, and celebrated victory after watching the Greek fleet sail away. Greek soldiers hiding inside it waited until the Trojans were sleeping to slaughter them while they slept.