The answer might seem paradoxical - so check the map! While, globally, the Atlantic Ocean is east of the isthmus and west of the Pacific, the general direction of the canal passage from the Atlantic to the Pacific is from northwest to southeast. This is because of a local anomaly in the shape of the isthmus at the point the canal occupies.

The Panama Canal is an American-built waterway connecting the two oceans. The idea of a canal dates back to the 16th century and belongs to Charles V. Anyway, his surveyors decided it was impossible to construct such a canal. The plan was implemented only in 1914, and nowadays around 14 thousand ships use it annually.

More Info: en.wikipedia.org