On January 3, 1868, samurai from the Chōshū and Satsuma domains seized the imperial palace in Kyoto and declared Emperor Mutsuhito — whose reign name became Meiji — restored to power, ending Tokugawa rule. Within five years, feudal domains were abolished, the samurai class dissolved, and universal military conscription introduced. Japan built railroads, installed telegraph networks, adopted a constitution (1889), and established an elected parliament. By 1905 Japan had defeated China and Russia in war, becoming the first non-Western state to defeat a European power in a modern conflict.