Crowds gathered to watch the star as he performed his hit song The A Team outside the town hall.
Speaking to the crowd, he said: "I've played so many shows here and have such love for this place - I'm so happy to be back here."
The singer grew up in Framlingham in Suffolk and still has a home there, and is also an Ipswich Town fan.
At his latest open-air gig, on the Cornhill, he played hits including Sing, Don't and Overpass Graffiti from his latest album.
Arthur, 10, was on his way to a guitar lesson when he heard Sheeran was playing and decided to abandon the lesson in favour of seeing the singer perform.
At the end of the gig, Sheeran offered him his guitar, signing it 'Arthur keep playing!'.
Arthur, who was also given an amp, said: "It's such a nice guitar as well, the amp is a really special gift because it's so precious to me because Ed Sheeran is someone that I kind of want to be like.
"He plays guitar and sings, and I love singing and love playing guitar, I've got a real passion for playing guitar."
He has only been playing the instrument for six months but said he was "already obsessed".
The advice from Sheeran was to play every day and Arthur said it had inspired him to "keep getting better and play even more".
"I'm going to improve so much from this point on, and it's going to be incredible to look back on this moment and know how lucky I was to get a guitar from Ed Sheeran," he said.
Helen, his mother, said: "What a brilliant experience for Ipswich, what a gift from our beloved Ed to Ipswich."
The singer announced on Instagram he was about to do a free gig near Ipswich Town Hall after buying a guitar at local shop Music World.
Holly Williamson 43, from Ipswich, was with her children when she spotted him playing.
She said: "It was such a lovely atmosphere, my children have never got to see Ed Sheeran before and it made their day.
"He's such an amazing local celebrity who is so down to earth and a man of the people."
Sheeran told the crowd: "I haven't been back to play a show in Ipswich since I played the Chantry Park shows, but those Chantry Park shows were the first I'd probably done since 2010."
The singer did play at The Swan pub in the town in 2010, but also did not mention that during a run of three shows in one day in 2014, he appeared at the Steamboat pub.
And in 2021 during coronavirus restrictions, the Ipswich Town fan played a gig with no audience at the club's Portman Road stadium, which was live-streamed on TikTok.