Mercury was used for a variety of ailments throughout history, despite it's harmful effects. Are there any actual medical benefits to mercury?

by OhMy8008

I read today that mercury was used to "cure" syphilis, but couldn't find any information on whether or not it made a difference. I've read about various mercury treatments throughout history, in many different locations by societies that (I assume) weren't linked to one another. If this is true and the use of mercury was used to cure a variety of ailments by many different people independent of one outside influences, did it actually provide any medical benefits? Were they aware that it was harmful (but unaware of the extent of the harm) and if so, did they simply believe that the benefits outweighed the detriments (due to having few/no other alternatives)?

i_post_gibberish

I posted a very similar question in /r/askscience years and years ago. I didn't get great answers, but you might find something worthwhile in the comments.