トンネルを抜けると雪国であった
Now, トンネルを抜ける means "to come out of the tunnel". 雪国 is the "Snow Country" and であった is the past tense of である, the "to be" verb in its literary form (according to tangorin.com).
How does と connect both these parts? What is its meaning here?