Original: From 1819 to 1839 it served as the state capital of Illinois.
Simplified: It was the capital of Illinois from 1819 to 1839.