If you had traveled to Cuba legally, and obtained the cigars before either the embargo was inforced, or before the $0 requirement was enforced, and you papers to prove it, then it is not illegal.
If you obtained them legally, then gave one to your friend, then HE is in possession of it illegally.
But yes, in all cases right now, obtaining them is not legal in any way by a US citizen. If you have duel citizenship and you travel outside of the US then you can obtain them legally, but cannot bring them back into the US legally.
And the law concerning 'outside the US', I believe, was part of the original embargo signed by JFK. But it's stupid because the laws of the US don't apply outside of the US borders, and unless this offense is extriditable, which of course it is not, it's a paper tiger. It is brought up every four years to swing the Cuban vote in South Florida. Plain and simple.
When Clinton was in office there was a big stink made about him buying a Cuban cigar at Heathrow airport.