From: Matthew 16:13-23:
Peter's Profession of Faith and His Primacy
 Now when Jesus came into the district of Caesarea Philippi, He asked His disciples, "Who do men say that the Son of Man is?"  And they said, "Some say John the Baptist, others say Elijah, and others Jeremiah or one of the prophets."  He said to them, "But who do you say that I am?"  Simon Peter replied, "You are the Christ, the Son of the living God."  And Jesus answered him, "Blessed are you, Simon Bar-Jona! For flesh and blood has not revealed this to you, by My Father who is in Heaven.  And I tell you, you are Peter, and on this rock, I will build My Church, and the powers of death shall not prevail against it.  I will give you the keys of the Kingdom of Heaven, and whatever you bind on earth shall be bound in Heaven, and whatever you loose on earth shall be loosed in Heaven."  Then He trictly charged the disciples to tell no one that He was the Christ.
Jesus Foretells His Passion and Resurrection
 From that time Jesus began to show His disciples that He must go to Jerusalem and suffer many things from the elders and chief priests and scribes, and be killed, and on the third day be raised.  And Peter took Him and began to rebuke Him, saying, "God forbid, Lord! This shall never happen to You."  But He turned and said to Peter, "Get behind Me, Satan! You are a hindrance to Me; for you are not on the side of God, but of men."
13-20. In this passage St. Peter is promised primacy over the whole Church, a primacy which Jesus will confer on him after His Resurrection, as we learn in the Gospel of St. John (cf. John21:15-18). This supreme authority is given to Peter for the benefit of the Church. Because the Church has to last until the end of time, this authority will be passed on to Peter's successors down through history. The Bishop of Rome, the Pope, is the successor of Peter.
The solemn Magisterium of the Church, in the First Vatican Council, defined the doctrine of the primacy of Peter and his successors in these terms:
"We teach and declare, therefore, according to the testimony of the Gospel that the primacy of jurisdiction over the whole Church was immediately and directly promised to and conferred upon the blessed Apostle Peter by Christ the Lord. For to Simon, Christ had said, `You shall be called Cephas' (John 1:42). Then, after Simon had acknowledged Christ with the confession, `You are the Christ, the Son of the living God' (Matthew 16:16), it was to Simon alone that the solemn words were spoken by the Lord: `Blessed are you, Simon Bar-Jona. For flesh and blood has not revealed this to you, but My Father who is in Heaven. And I tell you, you are Peter, and on this rock I will build My Church, and the powers of Hell shall not prevail against it. I will give you the keys of the Kingdom of Heaven, and whatever you bind on earth shall be bound in Heaven, and what you loose on earth shall be loosed in Heaven' (Matthew 16:17-19). And after His Resurrection, Jesus conferred upon Simon Peter alone the jurisdiction of supreme shepherd and ruler over His whole fold with the words, `Feed My lambs....Feed My sheep' (John 21:15-17) [...].23. Jesus rejects St. Peter's well-intentioned protestations, giving us to understand the capital importance of accepting the cross if we are to attain salvation (cf. 1 Corinthians 1:23-25). Shortly before this (Matthew 16:17) Jesus had promised Peter: "Blessed are you, Simon"; now He reproves him: "Get behind me, Satan." In the former case Peter's words were inspired by the Holy Spirit, whereas what he says now comes from his own spirit which he has not yet sloughed off.
"(Canon) Therefore, if anyone says that the blessed Apostle Peter was not constituted by Christ the Lord as the Prince of all the Apostles and the visible head of the whole Church militant, or that he received immediately and directly from Jesus Christ our Lord only a primacy of honor and not a true and proper primacy of jurisdiction: let him be condemned.
"Now, what Christ the Lord, Supreme Shepherd and watchful guardian of the flock, established in the person of the blessed Apostle Peter for the perpetual safety and everlasting good of the Church must, by the will of the same, endure without interruption in the Church which was founded on the rock and which will remain firm until the end of the world. Indeed, `no one doubts, in fact it is obvious to all ages, that the holy and most blessed Peter, Prince and head of the Apostles, the pillar of faith, and the foundation of the Catholic Church, received the keys of the kingdom from our Lord Jesus Christ, the Savior and the Redeemer of the human race; and even to this time and forever he lives,' and governs, `and exercises judgment in his successors' (cf. Council of Ephesus), the bishops of the holy Roman See, which he established and consecrated with his blood. Therefore, whoever succeeds Peter in this Chair holds Peter's primacy over the whole Church according to the plan of Christ Himself [...]. For this reason, `because of its greater sovereignty,' it was always `necessary for every church, that is, the faithful who are everywhere, to be in agreement' with the same Roman Church [...].
"(Canon) Therefore, if anyone says that it is not according to the institution of Christ our Lord Himself, that is, by divine law, that St. Peter has perpetual successors in the primacy over the whole Church; or if anyone says that the Roman Pontiff is not the successor of St. Peter in the same primacy: let him be condemned [...].
"We think it extremely necessary to assert solemnly the prerogative which the only-begotten Son of God deigned to join to the highest pastoral office. And so, faithfully keeping to the tradition received from the beginning of the Christian faith, for the glory of God our Savior, for the exaltation of the Catholic religion, and for the salvation of Christian peoples, We, with the approval of the sacred council, teach and define that it is a divinely revealed dogma: that the Roman Pontiff, when he speaks "ex cathedra", that is, when, acting in the office of shepherd and teacher of all Christians, he defines, by virtue of his supreme apostolic authority, doctrine concerning faith or morals to be held by the universal Church, possesses through the divine assistance promised to him in the person of St. Peter, the infallibility with which the divine Redeemer willed His Church to be endowed in defining doctrine concerning faith or morals; and that such definitions of the Roman Pontiff are therefore irreformable because of their nature, but not because of the agreement of the Church.
"(Canon) But if anyone presume to contradict this our definition (God forbid that he do so): let him be condemned" (Vatican I, "Pastor Aeternus", chaps. 1, 2 and 4).
Source: "The Navarre Bible: Text and Commentaries". Biblical text taken from the Revised Standard Version and New Vulgate. Commentaries made by members of the Faculty of Theology of the University of Navarre, Spain. Published by Four Courts Press, Kill Lane, Blackrock, Co. Dublin, Ireland. Reprinted with permission from Four Courts Press and Scepter Publishers, the U.S. publisher.