In The Return of the King, a guardian of the Citadel of Minas Tirith, named Beregond, befriends Pippin, and later, helps Pippin save Faramir from Denethor's madness. Denethor has the unconscious Faramir carried to the tombs of the Stewards, along with wood and oil, intending to burn himself and Faramir to death.
While Pippin runs to get Gandalf, Beregond tries to postpone the pyre. The gatekeeper will not let him pass, so Beregond kills the gatekeeper, runs to the tombs, and blocks the guards carrying Faramir (and the wood and oil) from entering the tombs. In the process, he is forced to kill two of the guards. Gandalf arrives in time, and saves Faramir, but Denethor kills himself. Beregond is relieved of duty and awaits judgement for his actions.
Later, Aragorn becomes king, and has to decide Beregond's fate.
"Beregond, by your sword blood was spilled in the Hallows, where that is forbidden. Also you left your post without leave of Lord or Captain. For these things, of old, death was the penalty. Now therefore I shall pronounce your doom1."
"All penalty is remitted for your valour in battle, and still more because all that you did was for the love of the Lord Faramir. Nonetheless you must leave the Guard of the Citadel, and you must go forth from the city of Minas Tirith..."
Beregond assumes that he is being exiled, and is heartbroken. But Aragorn continues:
"So it must be, for you are appointed to the White Company, the Guard of Faramir, Prince of Ithilien, and you shall be its captain and dwell in Emyn Arnen in honour and peace, and in the service of him for whom you risked all, to save him from death."
-The Lord of the Rings, The Return of the King, Book VI, Chapter 5: "The Steward and the King"
[Emyn Arnen is a hill about 20 miles from Minas Tirith, and the passage I quoted above goes on to say that it is "within sight of the City"]
Nothing in this passage suggests to me that Beregond is forbidden to enter Minas Tirith again, but Tolkien Gateway's entry on Beregond says:
Beregond was... forbidden from returning to the White City ever again.
Wikipedia's entry on Beregond and Bergil says Beregond was "banished" from Minas Tirith. So does the LotR wiki entry on Beregond. The book titled The Complete Guide to Middle-earth also says he was "banished", and the Tolkien Gateway entry cites this book as a reference.
Do we know if this is true? Was Beregond banned from Minas Tirith for life? The text itself certainly never says so.
Note 1: Tolkien uses the word "doom" here in the archaic Old English sense: it means "law or judgement", not "something inherently horrible and unpleasant". From the Wikipedia page for The Domesday Book ("Domesday" is a variant spelling of "Doomsday"):
The word "doom" was the usual Old English term for a law or judgement: it did not carry the modern overtones of fatality or disaster.
Note 2: This is apparently a subject of some debate among Tolkien fans and scholars. One interesting suggestion is that Beregond was banned from living in the city, but more as a result of the requirements of his new job than as part of an actual punishment.