Who Invented Pretzels?

Americans love pretzels, consuming around 181 million every year. But where do pretzels come from? Can we really credit one country with this tasty invention? Also, why do Philly pretzels look like that?