During his 27-year rule as President (1908–35) he established an absolute dictatorship. The foreign investment that he attracted to Venezuela enabled him to build extensive railways, highways, and other public works. Rich petroleum discoveries (1918) in the Lake Maracaibo basin provided a budgetary surplus which not only enabled Gómez to pay off the foreign debt but also assured him a favourable reputation abroad. Because of the brutal nature of the dictatorship, this reputation was not shared at home. When he died in office the city of Caracas marched in celebration.