In a painful manner; as if in pain.
I limped painfully down the stairs.
Badly; poorly.
That was the most painfully sung rendition of “Fly Me to the Moon” that I’ve ever heard.