Ibuprofen is a NSAID (Non-steroid anti-inflammation drug), so it has some effect on the inflammation too, not just to relief the pain. There are other NSAIDs too but some of them have lots of
side effects. Diclofenac is one that in my country is sold over the counter almost as often as Ibuprofen.
Of course, for severe inflammations (with inflammations, there are no infection) steroid anti inflammation drugs can be used, such as cortisone.