The Dai Nippon Teikoku (Greater Japanese Empire) was the political entity that ran Japan from 1868 to 1945. It was also known as "Dai-tou-a Kyoueiken" (Greater East Asian Co-Prosperity Sphere).
Meiji Era (1868 - 1912)
The Greater Japanese Empire arose after the end of The Tokugawa Era, when Japan was wracked with two rather civil civil wars (not that much bloodshed, relatively) and casually battered by British ships after the murder of a businessman who failed to bow to a Samurai. The last Shogun of the House of Tokugawa was pressured to resign by the Duchies of Satsuma and Choushuu, which first routed his armies and then declared their allegiance to the fifteen-year-old Emperor in preference to him. Crowned as the Emperor 'Meiji', the first years of his reign saw further conflict in the Boshin War of 1868-1869 - Satsuma-Choshu realised that the Tokugawa stepping down was not enough to ensure their control given that a third of the country's best land was the Tokugawa's private property. So they seized it and made it and the entire country - together with their own Duchies - a single administrative unit under the Emperor. For the first time Japan was a nation-state in anything more than in name only.
The Meiji era was marked by industrialization and economic development, modernization and a degree of westernization - the degree to which modernization meant westernization was a big deal, as one can only imagine. Culturally, Japan's earlier flirtations with Chinese culture had done something to prepare its people for this kind of change - but the radical restructuring of society that came with modernization was something that no tradition of cultural assimilation could prepare them for, and left many people wondering what exactly it meant to be Japanese - thus, the fierce debates over 'Nipponjinron' - 'ideas of Japanese-ness'.
The fairly sudden modernization affected almost all areas of Japanese society - language, etiquette, clothing, laws and law enforcement, etc. The new Imperial administration expanded the Tokugawa's programme of sending observers and students to Western countries to observe and learn their practices, and also hired foreign advisors - specialists in a plethora of technical fields - to staff their own colleges and universities. The new judicial system and constitution were largely modeled on those of Germany, for instance, because the formerly-of-Satsuma-and-Choshu ruling clique liked the idea of a strong Imperial Government and Military with rubber-stamp democratic assemblies. Also, their previous model—the French Second Empire—had had its ass thoroughly handed to it in the Franco-Prussian War at about the same time; obviously, the Prussian model was a winning one. Naturally, the government outlawed customs linked to Japan's feudal past - such as the bearing of weapons and top knot hairstyle, both of which were privileges of the nobility (think 'Samurai') - which was itself abolished along with the class system (of Nobles-Warriors, Artisans/Farmers and then Untouchables, in that order). Together with economic and administrative grievances, these policies saw the outbreak of Rebellion in the former Duchy of Satsuma.
It is during the Meiji era that Japan established itself as an international power and a colonial Empire. The newly industrialized and modernized Japanese forces allowed the Japanese Empire to field forces almost as good as if not quite on-par with those of China and Russia during the course of the First Sino-Japanese war and the Korean annexation. It was, however, Japan's centralized command system and the abilities of her commanders that saw her come out on top in both engagements. Though outnumbered, their forces were generally (far) better coordinated and more mobile - there are parallels to be drawn with the Franco-Prussian war in this regard.
Paying both the indemnities of the Sino-Japanese War and then the reparations from Boxer Rebellion on top of that were a huge drain upon the resources of the rather-weak and weakening central government of the Empire of the Qing - which, amazingly, continued to limp on for a few years yet until its final collapse and disintegration 1911-12. On the other hand, the wars established Japan as the new regional power in East Asia. There were a few ominous notes in all this, however. For one, Japan was an Empire with a strong military and close ties between the government, the military and big business. Second was the way Japan went about modernizing and responding to the interference of the colonial powers - via 'defensive Imperialism'. Take the Russo-Japanese war, for instance. Like the Sino-Japanese War, the war was basically fought over control of Korea; the Japanese claimed they were liberating it from foreign oppression. The Japanese started the war with a surprise-attack sea-based invasion of Russian Korea and China, which they launched without sea superiority. It was concluded when Japan made a negotiated peace with the Russian Empire, the negotiations being Theodore Roosevelt's personal initiative when it became clear that the War had ground to a stalemate that Russia could only win at a far higher cost than the Tsar was willing to pay. Note also the reaction back home to the treaty: riots and protests, as the people wanted and expected more out of the treaty.
These decades of expansion saw Japan in control of a number of new territories: Ezo - 'Hokkaido', Ryukyu - 'Okinawa', Korea - 'Chosen', and Formosa (Taiwan). The unprecedented (conditional) defeat of a European Great Power by a non-European one startled many in the Western world as Japan had been viewed as something of a backwater empire prior to that point. Prior to then, many had the impression that no matter how much Japan played copy-cat and styled herself after the Imperial powers, she would never truly be one of them because she was not of the same (superior) European substance.
However, the contest was not quite as uneven as it might appear at first glance. The Russian far east was at the end of a long and tenuous supply line. Far from the bright centers of St. Petersburg and Moscow it was properly viewed as a hardship and punishment post and its defenders were hardly numbered among their country's best soldiers. Also, the reinforcing Russian Baltic fleet had no choice but to try and fight their way through a Japanese blockade in a doomed attempt to reach their Pacific ports after sailing all the way around Africa. Still, few outside of Japan were prepared for just how quickly the Japanese were able to gain the upper hand; US President Teddy Roosevelt even publicly expressed admiration for them as "the plucky little guy" in the fight. To some extent the Russian Empire had also shot itself in the foot when, after using the unprovoked attack as a rallying point for imperialistic patriotism - to distract people from socio-economic problems - they appeared to have bungled the conduct of the war and then given in all too easily. Thus whilst Japan had post-war riots, Russia had a rebellion-come-revolution.
The Russo-Japanese war also provided the West with their first proper glimpse of the (fanatical) bravery of the Imperial Japanese soldiery as well as their willingness to endure both grueling hardships and astonishingly heavy casualties in the frontal (infantry) assaults necessitated by their relative lack of artillery and machine guns. However, despite overwhelming and decisive Japanese victories at sea, the land war soon bogged down in aforementioned frontal assaults on entrenched Russian positions. Faced with a much more intractable conflict then they had bargained for, both sides accepted an American offer of mediation that culminated in the Treaty of Portsmouth. Under not-inconsiderable American-European pressure to give back most of the territory they had occupied, save Port Arthur and its environs - it was a take-it-or-leave-it deal, as Russia was considering escalating (and quite probably winning) the War if the outcome looked particularly unfavorable - Japan acquiesced amidst nationalist protests and riots at home. In the long term the 'unfair' terms of the peace combined with the success of the military action - few within Japan knew how close the country had been to losing - to foster further anti-foreign sentiment and the feeling that the application of force was Japan's best foreign policy tool.
Taishō Era (1912 - 1926)
The Meiji era ended upon the establishment of the Taishō Emperor, Yoshihito, as ruler. The Taishō era is known as the "Taishō Democracy," as during this era that the lower house of the Diet (the House of Representatives) gained the upper hand in Japanese politics, and steps were made towards expanding the electorate (property qualifications were substantially reduced - although not eliminated - in 1925). Another significant event of the Taishō era was Japan's involvement in World War I where they, as allies of the British, seized many of the German-owned colonies in East Asia and Micronesia. (This time they were allowed to keep them under a League of Nations mandate.) The Japanese Empire was later asked by the United States to join an international force to intervene in the Russian Civil War following the collapse of the Tsarist regime. After the United States and its allies withdrew from Vladivostok following the capture and execution of Admiral Aleksandr Kolchak, leader of the White Russian Army, the Japanese elected to stay on, partly due to fears of the spread of Communism so close to Japan and Japanese-controlled Korea and Manchuria but mostly with the aim of establishing a Siberian puppet state to protect Japanese interests from a resurgent Russia. The continued Japanese presence concerned the USA, who suspected that Japan had territorial designs on Siberia and Russian Manchuria. Although Japan later withdrew due to diplomatic pressure - amidst further rioting and public disorder back home, as the deployment of so many troops overseas had caused a domestic rice shortage which compounded the people's disappointment and anger at being ordered around by the foreign powers - the United States and other Western powers were much more wary about Japanese imperialist ambitions after that point.
It should be noted that in many of these wars and conflicts, the Western world praised the Japanese for their conduct during the war. Many Russian and German prisoners found Japanese forces to be quite gentlemanly, and such prisoners were treated quite well until their release. Some German prisoners even emigrated to Japan after the First World War having become enamored with the Japanese due to the excellent treatment they received as prisoners. The Koreans and Manchurian Chinese, however, present a much more critical view of Japan during this time period, although it is agreed that, overall, the Japanese Imperial forces behaved with restraint—especially in comparison with how they behaved later.
Note, however, that the reign of the Taisho Emperor saw no real changes to either the constitution or the structure of the government. The achievements of 'Taisho Democracy' were ultimately ephemeral, limited as they were by a system which strongly favored - and saw a return to - a government dominated by the military and the bureaucracy.
Showa Era (1926 - 1945)
With the rise of the Showa era, the Japanese Empire went through the Great Depression. This resulted in the kurai tanima (the Dark Valley), a dark era of militarist fascism that lasted from around 1930 to the end of World War II. The whole society was taken over by a militaristic frenzy—the traditional Japanese self-restraint seemed to shatter completely. This increasing militarization fueled imperial ambitions and resulted in massive conscription to rapidly inflate the size of the armed forces. Rapid modernization had also resulted in a population boom and considerable social upheaval, particularly in rural Japan. Conscription also presented a solution to popular unrest by drafting dispossessed, unemployed, and rootless younger sons—the most likely potential troublemakers—into the military. To compensate for these social forces a brutal disciplinary doctrine—ostensibly based on that of the samurai, in reality based on a very selective interpretation of samurai values—was adopted by the leaders. Historians usually point to the adoption of torture to keep the soldiers in line as the ultimate source of Japanese brutality during the Second Sino-Japanese War and Pacific Wars. The US reaction to Japanese expansion - disapproval, and the placing of hard-hitting sanctions on strategic materials to bring the Japanese to heel (as the U.S. had already done thrice before - pressuring Japan, that is, not sanctioning her) directly led to them lashing out in an offensive to take all of south-east Asia, inclusive of the American Philippines. Caught up in this would be the day that has (together with the dropping of the Atomic Bombs) in most United Statian's opinions defined most/all prior and subsequent US-Japanese relations: the day the Imperial Navy attacked the US Pacific Fleet at anchor in Hawaii.
For Japan and China, the war started in 1937 with the Second Sino-Japanese War - although some say the conflict started as early as 1931, when elements of the Imperial Japanese Army invaded Manchuria and established a puppet state. ("The Manchurian Incident", an older and highly euphemistic Japanese name for the latter, is considered highly offensive by the Chinese and is subject to Kotobagari because: #1 it implies that the IJA's actions were in some way legitimate and #2 it implies that 'the Three Eastern/Northern Provinces' and their people have a claim to semi-autonomy/independence). This was followed up by such incidents as the Battle of Shanghai (1932) and ongoing economic warfare in Northern China, where the Japanese military tried to undermine the Chinese Nationalists' central government by supporting regional (separatist) warlords and smuggling huge quantities of goods either banned (i.e. opium and guns) or heavily taxed (e.g. medium-quality cigarettes). When the Japanese began a full-on invasion of China, it eventually merged into the whole mess that was World War Two. Japanese forces were involved in disgusting war crimes - primarily involving Prisoners of War and civilians - which in the space of two years blackened what had until then been a fairly good reputation. Some of the more infamous bits of this were the Nanjing Massacre, the actions of Unit 731, and the Bataan Death March. The Other Wiki has a page on it.
Mostly forgotten between the Second Sino-Japanese War and World War II were the Soviet–Japanese Border Wars, a series of border conflicts between Japan and the Soviet Union between 1938 and 1939. While the Japanese Empire went into the conflicts with the confidence of their victory in the Russo-Japanese War, the relatively well-equipped Red Army of the USSR would prove to be a much tougher nut to crack. This conflict showed clearly how badly outdated and outclassed the Imperial Japanese Army was in terms of equipment—especially in the development of armored vehicles since what few tanks they had were all no match for even Soviet light tanks. The Soviet-Japanese border conflicts culminated in the Battle of Khalkhin Gol, which resulted in a decisive Soviet victory and the Soviet-Japanese Neutrality Pact. The latter would be the reason why there was little Soviet-Japanese conflict for most of World War II. The Soviets would later break the pact and invade Japanese-held Manchuria on August 9, 1945, less than a week before the Japanese surrender.
Ironically, Imperial Japan actually managed to achieve one of its goals of the war because it effectively ended European domination over Asia. This excuses neither the atrocities committed by Imperial Japan nor its true intention, which was to supplant European imperialism with its own. "Asia for Asians" may have been the slogan that the Imperial Japanese government used throughout Asia, but in practice it was more often interpreted as "Asia for Ourselves", and local populations who may have welcomed the Japanese as liberators were quickly disabused of these notions by their so-called benefactors' predilections for exploitation, genocide, racism and cruelty. While the true toll can never be tallied, it's estimated that anywhere between 30 and 50 million people died under the "customary brutality" of Japanese military occupation and the associated famines and epidemics, most of the casualties being civilians. It was at this point that the Empire adopted the term "Greater East Asian Co-prosperity Sphere" to collectively refer to those nations thus "freed" (albeit free in name only) and run by puppet governments.
To prevent a second Treaty of Versailles, and because Japan was needed as an ally against the emerging communist regimes in Asia, America was very soft on Japan after the surrender. Additionally, several senior Japanese officers who weren't involved in war crimes were nonetheless tried, convicted, and executed on trumped-up charges primarily to avenge the humiliating defeats they had inflicted on U.S. and British forces during the early stages of the war, leading some Japanese people to dismiss those war crimes trials that did occur as "victors' justice."
It is sometimes claimed that unlike Germany, which as a nation apologized for the actions of the Nazis in Europe, Japan has never formally apologized to the Asian nations that were invaded by the Japanese armies. Several apologies from Prime Ministers and the Diet and Japan has paid over 300 billion Yen in war reparations to the nations it occupied, with some formal apologizes to former POWs by a few Japanese ambassadors. However, the lack of a Japanese counterpart of "Denazification" and extremely cautious treatment about the mention of the subject in textbooks makes Asians that lived through the Japanese occupation continue to see the Japanese as generally unrepentant, and is also largely responsible for the country's seemingly cavalier attitude toward its past crimes. It should however be noted that virtually all Japanese school history textbooks do describe Japanese war atrocities (and in particular, the Rape of Nanking), and despite the recent attempt by the right-wing Society for History Textbook Reform to introduce a textbook omitting/casting doubt on the Nanking Massacre, comfort women, and general colonial nastiness, widespread protests and denunciation by the Japan Teachers Union led to the book being introduced in a measly 18 of the country's 11,000+ junior high schools.
The Japanese are proud people; admitting such crimes against humanity would be a serious social sin of losing face, and as such, the education system in Japan tends to "whitewash" the more brutal aspects of Japanese history (something non-existent in Germany, where a good chunk of history class is spent on Nazi Germany), pretending little of interest actually happened. This translates to few works of Anime (or other media) referencing this history, even when the work is "historic" in nature, an action that causes Japan's neighbors to take great offense. Then there's the fact that the failure to officially "come clean" has also allowed plenty of scope for Japanese right- wing groups to offer their own revisionist take on the subject, which can be summed up as "we didn't do anything bad to anyone, and if we did, they deserved it," and is if anything even more offensive to Japan's neighbors. There's also some contributions from more extreme or misguided elements of the fandom of Japanese pop culture, good old ultranationalism, as well as plain old trolls (the largest forums in Japanese netspace, 2ch and 2chan, are notorious for racist trolling, some of which is serious), which hasn't helped.
Note that Japan is still officially an Empire (in fact, it's the only country that still has an Emperor.)