Methods of treating bacterial infection by in a subject by administering a pharmaceutical composition including a celecoxib derivative are described. The compounds are particularly useful for treating infection by bacteria capable of growing inside macrophages, such as Myocobacteria tuberculosis.