The Blazers have tried at different times in the past to add Anthony and made an attempt to acquire him when he was with the New York Knicks.
Blazers president of basketball operations Neil Olshey and Anthony's agent, Leon Rose of CAA Sports, stayed in contact about Anthony since the preseason, sources said. Conversations picked up over the past two days, and Olshey and coach Terry Stotts talked directly with Anthony on Thursday before reaching an agreement.
Portland is lagging toward the bottom of the Western Conference standings with a 4-8 record, having lost its past two games.
Anthony, 35, will join the Blazers on their upcoming six-game road trip, which starts Saturday against the San Antonio Spurs, sources said.
Power forward was the position where the Blazers were most vulnerable, and a shoulder injury to Zach Collins amplified the void there. Anthony returns to fill that need.
He could fit in well with the Blazers, who have struggled to get production from their forwards this season, ranking 27th in points per game (36.3), tied for 28th in assists per game (5.5) and last in field goal percentage (39%).
Portland star Damian Lillard was upbeat on the addition of Anthony.
"I believe he can help us," Lillard told ESPN's Rachel Nichols. "Obviously I'd like to see our early-season struggles turn around, and hopefully we can be part of a great bounce-back for Melo as well."
Lillard said in September that Portland has its sights set on an NBA title, and that's something Anthony has yet to achieve. He is one of 19 players in NBA history with 25,000 points and 6,500 rebounds, and only four have not won an NBA title: Karl Malone, Dominique Wilkins, Alex English and Anthony.
There was a time following his release by the Houston Rockets when Anthony said he questioned whether he wanted to play again, but he told ESPN's Stephen A. Smith in August that he was ready to return.
"I'm in the gym every single day," Anthony said. He also noted that "silence is not my surrender" and that he had been quiet until then because he felt he needed to step away from the game to "reevaluate myself, reevaluate my career, reevaluate my life."
Anthony, a 10-time All-Star and six-time All-NBA player, suited up most recently for the Houston Rockets in a 10-game stint that ended early in the 2018-19 season.
Anthony won the league's scoring title in 2012-13, averaging 28.7 points per game. That season was the last time the Knicks made the playoffs and preceded a five-season absence from the postseason for Anthony, who had made the playoffs for 10 consecutive seasons over his time in Denver and New York.
LeBron James, a longtime friend of Anthony's, said he was happy to hear that he was getting another shot with an NBA team.
"He belongs in this league," James said. "I'm happy the Blazers gave him an opportunity. He'll make the most of it. We'll see what happens. I'm just happy he's back in the league."
ESPN's Dave McMenamin contributed to this report.