A number of Catholic priests have served in civil office. In keeping with the principle of separation of church and state,
the Catholic Church discourages this practice.
In canon law Canon law is internal ecclesiastical law governing the Catholic Church, the Eastern Orthodox churches, and the Anglican Communion of churches. In the Roman Catholic Church, it is promulgated by the pope. The Codex Iuris Canonici governs the Latin Church, which comprises the larger part of the Roman Catholic Church. 
Canon 285 of the
1983 Codex Iuris Canonici is a provision of Roman Catholic canon law that prohibits members of the Catholic clergy from doing things that are "unbecoming" or "foreign to the clerical state". In addition, it prohibits  diocesan priests and bishops from serving in "public offices which entail a participation in the exercise of civil power". 
Law in particular countries
You can help by adding to it. ( November 2012)
Constitution of Bolivia prohibits clergy from serving as president. 
Constitution of Costa Rica prohibits clergy from serving as president. 
Constitution of El Salvador prohibits clergy from serving as president. 
Constitution of Honduras prohibits clergy from serving as president. 
Constitution of Mexico prohibits clergy from serving as president. 
Article 121, section i of the
Constitution of Myanmar prohibits a member of a religious order from serving as president.  
Constitution of Nicaragua prohibits clergy from serving as president. 
Article 235 of the
Constitution of Paraguay prohibits any minister of any religion from serving as the president.
Constitution of Venezuela prohibits clergy from serving as president. 
Examples by country
Austria Ignaz Seipel, a priest, theologian and academic, served as the Foreign Minister of Austria from 1926 to 1929 and in 1930, and served as Chancellor of Austria from 1922 to 1924 and 1926 to 1929.
Theodor Innitzer, who would become a cardinal and Archbishop of Vienna, served as the Austrian Minister of Social Affairs from 1929 to 1930.
Andrew Hogan was the first Catholic priest to serve as a Canadian Member of Parliament, first elected to the House of Commons of Canada in 1974 and serving until losing the 1980 election.
Robert Ogle was elected to the House of Commons in 1979 and served until 1984, when he did not run for reelection as a result of the new Vatican ban on clergy in public office.
In 2008, Rev.
Raymond Gravel was forced by the Vatican to leave the House of Commons of Canada because, among other things, he supported abortion rights and same-sex marriage. 
Daniel Herman is laicized Roman Catholic priest and he is currently Minister of Culture representing Christian Democratic Union - Czechoslovak People's Party ( KDU-?SL).
Fernando Arturo de Meriño, a priest who would later become an archbishop, served as the President of the Dominican Republic from 1880 to 1882.
Barthélemy Boganda, a priest from Ubangi-Shari, was elected to the French National Assembly in 1946, serving until 1958. He left the priesthood in 1950 and married, and from 1958 to 1959 he was the first Prime Minister of Central African Republic.
Germany Beda Weber was a German Benedictine priest who served as a member of the Frankfurt Parliament in 1849.
Ludwig Kaas was a priest of the Weimar Republic. In 1919 he was elected to the Weimar National Assembly and in 1920 was elected to the Reichstag, where he served until 1933.
For a brief period in 2011, during the
Libyan Civil War, the Nicaraguan priest Rev. Miguel d'Escoto Brockmann served as the Libyan ambassador to the United Nations.
In the 1970s and 80s, the
President of Nicaragua, Daniel Ortega, appointed three priests to his cabinet: Rev. Miguel d'Escoto Brockmann as Minister of Foreign Affairs, Rev. Fernando Cardenal as Minister of Education, and his brother, Rev. Ernesto Cardenal, as Minister of Culture. 
In 2005, Bishop
Fernando Lugo requested laicization to run for office. His request was denied. In 2008, he was elected president of Paraguay, in spite of article 235 of the Constitution of Paraguay, which prohibits any minister of any religion from serving as President. After his election, he was laicized. In 2012 he was removed from the presidency for unrelated reasons.
Poland Hugo Kotaj was a Polish noble and Catholic priest who in 1786 received the office of the Referendary of Lithuania. He co-authored the Constitution of May 3, 1791 and held a variety of posts before falling out of political favor in 1802 as a result of his radical views.
Stanis?aw Staszic was a philosopher and political activist who served in the government of Congress Poland.
Slovakia and Czechoslovakia
Andrej Hlinka served in the Parliament of Czechoslovakia from 1920 to 1938 and was leader of the Slovak People's Party from 1913 until his death.
From 1939 to 1945,
Jozef Tiso, a priest, was President of the First Slovak Republic, a satellite state of Nazi Germany. Following World War II, he was convicted and hanged for treason that subsumed also war crimes and crimes against humanity.
Augustine Geve was a Catholic priest who served as a member of the National Parliament from 2001 to 2002 and was Minister of Youth, Women and Sports from 2001 to 2002. He was assassinated on 20 August 2002.
Possibly the earliest known instance of a Catholic priest serving in public office in the United States was
Gabriel Richard. Born in France, he founded the University of Michigan and served as a delegate from Michigan Territory from 1823 to 1825.
Robert Drinan and Robert John Cornell, have served in the United States Congress. In 1980, when Pope John Paul II insisted that priests not serve in elective office,  Representative Drinan withdrew from his re-election campaign, and Cornell withdrew from his bid to re-gain the seat he had lost in the 1978 Congressional election. In 1983, the prohibition on serving in governmental office was codified as section 3 of canon 285 of the Codex Iuris Canonici.
List of priests who have held public office
Listed below are the names of the priests, and the countries they served in parentheses.
Kevin Schmiesing. "John A. Ryan, Virgil Michel, and the problem of clerical politics". VLex.com.
^ The Catholic Church includes a number of "particular" churches that share the same faith and are in communion with the Pope in Rome. The term "
particular church" can be used to refer either to a diocese, under the leadership of a bishop, or to an "Ecclesia ritualis sui iuris", which is a larger body of believers that may comprise many dioceses. Nearly all of the geographical dioceses of the Roman Catholic Church in the United States, for example, belong to the Latin Church.
^ a b
"THE OBLIGATIONS AND RIGHTS OF CLERICS". Code of Canon Law - IntraText. Libreria Editrice Vaticana.
^ a b c d e f g h
"In 30 countries, heads of state must belong to a certain religion". 2014-07-22 . Retrieved .
"Constitute". www.constituteproject.org . Retrieved .
"Priest MP leaves politics after pressure from Vatican"
canonlawmadeeasy (2012-09-20). "Can Priests Hold Public Office?". Canon Law Made Easy . Retrieved .
Martin, Douglas (12 May 2009). "Robert J. Cornell, Priest Who Served as Congressman, Is Dead at 89". obituary. The New York Times.