Yes and no.
In 1910, Japan invaded Korea and held it until the end of WW2. During that time, they made a concerted effort to kill off anyone they thought might put up a fight, and that included a lot of the traditional Korean martial arts guys. Some of them hid out in the mountains and kept their art alive.
After the Korean conflict, When S. Korea was looking to create a national sport, they got all the survivor (what few were left) plus people who were trained in Shotokan and other Japanese styles and tried to do a "melting pot" sort of thing. That was the origin of Taekwondo.
So, yes. It has origins in karate. But also, yes, it has origins in the traditional Korean martial arts that trace back to the Silla dynasty, almost a thousand years ago.