Great Britain's men won European Games gold in the team fencing foil with a 45-41 win over Olympic champions Italy.
GB lost only three of the nine bouts, with Richard Kruse winning three, alongside team-mates Alex Tofalides and Marcus Mepstead.
There were six swimming medals, among them gold for Duncan Scott on the last day in the pool, but Natalie Powell and Gemma Gibbons missed out in the judo.
GB will finish with 47 medals in Baku; 18 gold, 10 silver and 19 bronze.
Kruse, who won the last bout against third-ranked Italy, said: "I knew we were capable of it.
"On paper they are the stronger team but we showed some real willpower today to come together and showed the whole is greater than the sum of its parts."
In judo, Welsh fighter Powell lost her bronze medal -78kg meeting with Ana Velensek of Slovenia and finished fifth.
The 24-year-old Commonwealth champion had earned a spot in the third-place bout after winning her repechage against Hungary's Abigel Joo.
Earlier on, Olympic silver medallist Gibbons was beaten in the round of 16 in the same weight category by Ukraine's Victoria Turks.
Speaking after her second-round defeat in Baku, Londoner Gibbons, 28, told BBC Sport: "It was a fight I needed to be winning.
"At the moment I'm managing to take some good wins but I'm not able to put three or four of them together. That's what it takes to win a tournament like this. It's not good enough.
"It's a tough tournament here - probably just under the level of a World Championships or Olympics. It's not an easy event but it's one we [Team GB] should be winning a couple of medals in."
Medals for Britain's swimmers
Duncan Scott and Cameron Kurle secured a one-two in the 200m freestyle as Britain won six medals on the final day of swimming action.
Charlie Attwood picked up bronze in the 100m breaststroke while Abbie Wood was the day's other individual winner with bronze in her 200m individual medley final.
And there was more relay success for the Brits as the women's 4x200m freestyle team (Hannah Featherstone, Darcy Deakin, Georgia Coates and Holly Hibbott) took bronze and the men's 4x100m medley quartet (Scott, Attwood, Luke Greenbank and Martyn Walton) won silver to take the tally to 23 for the competition.