Detective Garda Colm Horkan has been remembered as "a good man, one of nature’s gentlemen" at his funeral mass in Co Mayo.
Hundreds of Gardaí performed a guard of honour from his home to the church.
Detective Garda Horkan’s remains were carried by his brothers from the family home to St James’ Church.
Members of Castlerea Garda station, who were on duty on Wednesday night when Detective Horkan was killed, performed a guard of honour from the gates of the church.
A screen was also set up at Charlestown GAA pitch for members of the community to watch the ceremony.
His brother Brendan told the service that he was an "absolute treasure" and a "man of real class".
"It's a sad day for the Horkan family, and for the town of community of Charlestown, as we lay our brother to rest long before his time.
"Our community has lost a pillar in the true sense of the word, as we struggle to comprehend the shocking events of Wednesday June 17th - when a man was cut down in the prime of his life, doing the job he loved and serving the country in the best way he knew how".
Addressing the congregation, Monsignor Tommy Johnston said: "The gunshots that rang out in the early hours of Wednesday morning echoed not just in the town of Castlerea but right across the country, spreading a story of tragedy and sadness and the loss of life of a detective garda.
"A news reporter on an early morning bulletin said the community of Castlerea is shocked and deeply saddened by this death.
"The name has not yet been released but we know he was from Mayo and so another community will be shocked and saddened by this death, and I thought: 'I pity the priest who has to do that funeral.'
"Little did I think I would be that priest and that the detective garda was Colm."
"Colm Horkan was a good man, one of nature’s gentlemen, that and more, as someone said.
A Garda notebook, a Charlestown Sarsfield GAA jersey, his car keys, a CD - showing his love of music - a family photo, a shirt symbolising "his love of fashion", and a Liverpool tie pin were offered as symbols by members of his family.
Monsignor Johnston said "hundreds of people" lined the streets on Friday night as his body was brought back home.
"Old and young gathered for that walk with the various teams, senior and underage, women and men flanking the hearse and the following cars, a silent salute for a man whose voice was gentle and his approach respectful.
"That gentleness and respect earned the good will of so many and endeared him to young and old."
He added: "This is the church where Colm was baptised where he received his first communion and confirmation, here for a number of years he was a minister of the word and now he is here for the final farewell."
"Death brings sadness and grief and loneliness and loss, and it also brings questions, questions that may take us beyond ourselves in our search for answers.
"In the case of Colm, questions have us wonder why did this tragedy happen, why did Colm die, why was this life which had so much to offer taken away so soon.
"I cannot answer those questions, but it seems when God takes the young he takes only the very best."
He also read some words, which were written by a friend as a tribute to Colm.
"Colm was a cherished member of our community, a brother to everyone, young and old.
"We grew up together, played together and performed in school plays together.
"Now we are in shock and deep mourning. We are heartbroken for Colm’s family, colleagues and many, many friends.
"It will take a long, long time for our community to come to terms with this senseless act of violence against our brother, Colm.
"Now Colm is God’s right-hand-man, his very best wingman.
"Now we ask God, surrounded by all the saints and angels in heaven, to wrap Colm in his arms, to comfort and console Colm’s family, colleagues and many, many friends, near and far."