Judge returns to Griffin Park after spending much of last season there on loan, playing 22 games, scoring seven goals, in helping the club win promotion to the Sky Bet Championship.
The former Republic of Ireland U21 was originally a product of Blackburn's Youth Academy and had loan spells with Plymouth Argyle and Notts County.
Judge was one of Gary Bowyer's first signings as manager 12 months ago, but was restricted to just 12 first-team appearances on his Rovers return after leaving the club to join County permanently in January 2011.
The 25-year-old's seven goals for the west London club included the decisive penalty in the 1-0 win over Preston that secured their place in the Championship.
Brentford manager Mark Warburton said: "Alan displayed all of the right qualities both on and off the pitch and played a big role in our achieving the desired goal of promotion to the Championship.
"His evident playing ability is matched with an outstanding work ethic and level of professionalism and his commitment to Brentford has been first class from the very outset.
"I have no doubts that Alan will make a significant impact in the Championship and I am very much looking forward to watching him continue his development with the club in the months ahead."