According to the first paragraph of the Wikipedia article (emphasis mine):
Otaku (おたく/オタク) is a Japanese term for people with obsessive interests, particularly in anime and manga. Its contemporary use originated with Akio Nakamori's 1983 essay in Manga Burikko. Otaku may be used as a pejorative; its negativity stems from a stereotypical view of otaku and the media's reporting on Tsutomu Miyazaki, "The Otaku Murderer", in 1989. According to studies published in 2013, the term has become less negative, and an increasing number of people now self-identify as otaku, both in Japan and elsewhere.
The first two sources are references to Nakamori's essay, where source 2 is a translated rendition of that essay.
Wikipedia goes on to mention that two animators, Haruhiko Mikimoto and Shōji Kawamori, had used the term お宅 (おたく|otaku) as a formal, second person pronoun ("you"), which allegedly "some fans used... past the point in their relationships where others would have moved on to a less formal style."
The jisho.org entry explains:
you (referring to someone of equal status with whom one is not especially close)
Honorific or respectful (sonkeigo)
This awkward use of the pronoun led to Nakamori choosing it to refer to anime fans, seemingly to characterize their social awkwardness (Though Wikipedia cites the Chinese edition of a book called Otaku Shijou no Kenkyuu, this appears to be backed up by Nakamori's second essay on otaku, from what I can understand of it).
So what does this mean? Was the term otaku derogatory from the start? It seems like it was. According to Lawrence Eng, who completed a PhD dissertation on the topic of otaku culture (emphasis mine):
In 1983, the first published report appeared on the usage of "otaku" amongst fans. Akio Nakamori wrote a series of articles called "Otaku no Kenkyu" (Studies of Otaku) in Manga Burikko. He called those hard core fans who called each other "otaku" the "otaku-zoku" ("zoku" meaning tribe). His was perhaps the first article stereotyping otaku as being anti-social, unkempt, and unpopular. I've heard that the column was short-lived, and it didn't have a large impact on otaku culture (who pretty much ignored or was already used to such unfair stereotyping and discrimination).
Following the coining of the phrase, the so-called Otaku Murderer came into the public mind, which certainly didn't do the otaku crowd any favors, as you have already mentioned.
So back to that third source cited by the Wikipedia article. In 2013, in a study of 137,734 people, 42.2% answered that they think they are in some part "otaku," and the other 57.8% said they did not. The article continues by breaking down the results by age range (teens, twenties, thirties, and so on):
From this data, we can guess that somewhere during the '80s and the '90s (when people who are in their 50s and 40s now were in their 20s, and had grown up with anime and manga), the term otaku became more popular, and that trend has increased such that a majority of today's (Japanese) teenagers would consider themselves in some part otaku, and thus it would appear that the term is no longer considered quite as derogatory as it once may have been. The article also offers three examples of answers given by people who responded that they identify as otaku, which may shed some light on the reasons behind the mentality shift (translations mine, take them with a grain of salt):
"[I'm a] soccer otaku. Rather than being about an enjoyable hobby, it's having the energy to be passionate about something"
"If there's a game you like, you'd probably end up talking about it for hours"
"im an otaku for foreign dramas and their voice actors lol"
This is just my speculation, but it's almost as if the term otaku has become diversified from its original connotation of an obsessiveness over anime and manga specifically. In other words, nowadays one can be an otaku for just about anything, which may be the reason for which it's become more of a popular term.
The term otaku seems to have initially been coined to characterize certain negative stereotypes about anime and manga super fans, but over time has become more accepted—to the point that a majority of Japanese teens would say they identify as being, in some part, otaku.