Dole would serve as the first and only president from 1894 to 1898. Dole in turn appointed Thurston to lead the lobbying effort in Washington, D.C. to secure Hawaii's annexation by the United States. Dole's government secured diplomatic recognition from every nation that had recognized the Kingdom of Hawaii, and weathered several attempts to restore the monarchy, including a January 1895 counter-rebellion led by Robert William Wilcox. After being defeated, Wilcox and the other conspirators were captured and sentenced to death, but had their sentences reduced or commuted by Dole. Queen Liliuokalani abdicated and, under duress, swore allegiance to the Republic of Hawaii, declaring, "I hereby do fully and unequivocally admit and declare that the Government of the Republic of Hawaii is the only lawful Government of the Hawaiian Islands, and that the late Hawaiian monarchy is finally and forever ended and no longer of any legal or actual validity, force or effect whatsoever." She later provided a more detailed accounting of the events from her perspective in her book, "Hawaii's story by Hawaii's queen, Liliuokalani". On July 4, 1898, the U.S. Congress passed a joint resolution to annex the Republic of Hawaii. Known as the Newlands Resolution (named after Congressman Francis Newlands), it came into effect on August 12, 1898. A formal ceremony marking the transfer of Hawaiian state sovereignty to the United States was held that day on the steps of ʻIolani Palace where the Hawaiian flag was lowered and the American flag raised in its place. Under the terms of the Resolution, Dole retained the powers he previously exercised as President of Hawaii while Congress developed a new Hawaiian territorial frame of government. Later, when one was established through the Hawaiian Organic Act, President William McKinley appointed Dole as the first governor of the Territory of Hawaii. Dole assumed the office on June 14, 1900 but resigned November 23, 1903 to accept an appointment by President Theodore Roosevelt as judge for the U.S. District Court of Hawaii after the death of Morris M. Estee. He served in that post until December 16, 1915 and was replaced by Horace Worth Vaughan. Dole also served on commissions for Honolulu parks, and the public archives. He died after a series of strokes on June 9, 1926. His ashes were interred in the cemetery of Kawaiahao Church. Dole's cousin, Edmund Pearson Dole, came to Hawaii to practice law in 1895, and became Attorney General of Hawaii from 1900 to 1903.