In a comment to a recent post, Scott asks why someone doesn’t mention that you can’t make the en passant capture if the King is in check. The short answer is that you can make the en passant capture if it removes the check.
(Here are two videos to help illustrate the en passant rule.)
So, for example, in the following diagram, Black has just played 1… d5+. White’s King is in check and he has a pawn in position to make an en passant capture.
It is perfectly legal in this position for White to play exd6 (and it would be the best move on the board!), capturing the pawn en passant and removing the check against his King. The important point to remember here is that the capture is legal if it removes the check, but would be illegal if it did not remove the check.